Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes How to create Rest based WEb service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to create Rest based WEb service" Watch "How to create Rest based WEb service" New topic
Author

How to create Rest based WEb service

Kacee Saxena
Ranch Hand

Joined: Mar 04, 2008
Posts: 54
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

Joined: Aug 19, 2005
Posts: 2906
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 ]

    "Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
    Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
    William Brogden
    Author and all-around good cowpoke
    Rancher

    Joined: Mar 22, 2000
    Posts: 12681
        
        5
    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


    Java Resources at www.wbrogden.com
    thilsen kumar
    Greenhorn

    Joined: Jul 10, 2007
    Posts: 13
    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

    Joined: Mar 22, 2000
    Posts: 12681
        
        5
    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

    Joined: Aug 03, 2002
    Posts: 425
    If you have a java background then "Restful java webservices" is a resource to reference for starting restful webservices in java


    Rahul Juneja
    ThoughtClicks - http://techlabs.thoughtclicks.com
    thilsen kumar
    Greenhorn

    Joined: Jul 10, 2007
    Posts: 13
    Thank you all for the reply

    Regards
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to create Rest based WEb service
     
    Similar Threads
    Any feedback for SCDJWS Beta?
    VS.NET 2003 Example App is somewhat architecturally similar to SCEA app
    My personal test review about SCDJWS 5 beta
    Best implementation
    Issues related to RESTful web servicers