• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create Rest based WEb service

 
Kacee Saxena
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,

Im struck since many days as how to develop a REST based web service. Mostly all articles on net educates you to create service from popular IDEs like NetBeans, WSAD,etc. I want to develop a Hello Rest service that generates " XML response".

My problem is im not getting the start point of it. Since java code automatically gets created for web service. XML i dont know . So what should i write to create a service!

Also i read that service can be created in Net Beans from Entity Class.I created Entity class , but somehow its showing invalid entity class and hence fail to create service out of that. I know this is a very poor question but guyz please help me if anyone of you have created Rest Service before.

Many thanks,
Kacee
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Originally posted by Kacee Saxena:
I want to develop a Hello Rest service that generates "XML response".


Well REST looks at it a bit differently (even though there are examples that do exactly what you are asking for). RESTful web services isn't something that can be learned from looking at code and APIs - there are other concepts at work that you should understand first. RESTful Web Services is currently the best material for these concepts and there is precious little Java code in there.

However you may want to look at the Restlet site for some more hands on material. Download the framework, try the samples and have a look at some of the other links.

JSR 311: JAX-RS: The Java� API for RESTful Web Services is too much of a moving target to be helpful to the neophyte.

Mostly all articles on net educates you to create service from popular IDEs like NetBeans, WSAD,etc.


So far I have found that most IDEs are obstacles to understanding web services. They are fine once you know what is going on - however before that they shield you from the kind of detail that would help you to understand what is going on.

XML i dont know.

Actually REST is de-emphasizing the importance of XML. The content-type of the "representation of state" can be any valid media-type, plain text, XML, JSON, etc. However you should be comfortable working with the media-types that you choose to use.

Anne Thomas Manes:
  • REST: Is it the Next Big Thing?
  • How NOT to do RESTful Web Services

  • [ March 04, 2008: Message edited by: Peer Reynders ]
     
    William Brogden
    Author and all-around good cowpoke
    Rancher
    Posts: 13064
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I agree that the RESTful Web Services book is a great resource. The authors are very good at pointing out where people trying to sound RESTful are going astray and getting all tangled up in trying to make RPC style services look RESTful.

    I just spent some time playing with NetBeans 6.0 which has a plugin for using the current JSR 311 (Jersey) implementation. It all seems unnecessisarily complicated to me.

    Bill
     
    thilsen kumar
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,
    I am new to web services. I want to create RESTful Web Service using java based application with using tomcat.

    What are the technologies i need to use to create a simple application?

    Thanks & Regards,
    thilsen
     
    William Brogden
    Author and all-around good cowpoke
    Rancher
    Posts: 13064
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    1. You should have made a new post rather than resurrecting this old one.

    2. However that old advice is still good, both the Restlet and the Jersey projects are well thought of.

    Bill
    (personally I have only used Jersey)
     
    Rahul Juneja
    Ranch Hand
    Posts: 425
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If you have a java background then "Restful java webservices" is a resource to reference for starting restful webservices in java
     
    thilsen kumar
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you all for the reply

    Regards
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic