File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes REST webservice consumers should change their API to support REST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "REST webservice consumers should change their API to support REST " Watch "REST webservice consumers should change their API to support REST " New topic
Author

REST webservice consumers should change their API to support REST

Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 125
Hi,

I am migrating from JAXWS with CXF to REST WS. When client consuming the REST WS needs to change their API to support REST WS or still they can go with JAXWS? We have 10 consumers hence i here system an change is neded to consume REST WS exposed from our app? What is pros and cons of REST compared to JAXWS? Please clarify and let me know opinion on the same about the impact,etc.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Depends on the client API you're using. Technically it would be possible to create a client API that that can access both SOAP and REST WS using the same API (just using a different URL, or maybe different parameters), but it sounds unlikely to me. So normally you would have to adapt the client.


Ping & DNS - updated with new look and Ping home screen widget
Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 125
Thanks. The producer is completely based on REST WS , for consuming jersey REST client is used. Hence please clarify how we create a client API which supports both SOAP & REST WS? Whether it is the best way of doing ? If not then it is always better to use REST Client API if the producer is also REST? Please clarify.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
I'm not following. If you're using the Jersey API for the client -as you said you do-, then there's no way to consume a SOAP WS. Jersey simply doesn't do that.

If you have a REST WS, then you need a REST client. If you have a SOAP WS, then you need a SOAP client.
Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 125
Thanks Ulf, my question is without using the REST client by sending only WADL to the client can they generate the client API to consume the REST WS which uses jersey as an implementor? which will ensure that from the client side they dont have to create any REST API to consume REST WS? Is it possible? I hope I am clear with my question.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Yes, the WADL is sufficient to build a REST client, whichever client library is used. I suggest you build a client yourself using just the WADL so that you know what's involved.
Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 125
Thanks Ulf again, which clearly states irrespective of the REST webservice implementer which we use like jersey, cxf, restlet, etc for producing a REST webservice, for the client to consume the REST WS if we send a WADL , they can create the client API on their own can be jersey or cxf or restlet to consume the REST WS right? So for producing a WS we can use jersey and for consuming we can use CXF right? Please clarify.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
I have no idea what client support CXF has, so I can't speak to that. What I'll state again (and I thought me previous post was already unequivocably clear on that, but maybe not) is that the WADL constitutes the contract - it doesn't matter what technology is used on either side.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: REST webservice consumers should change their API to support REST
 
Similar Threads
How to deploy a JAX-WS webservice which is both Service Provider and Consumer for someother Service?
Web Services Security in tomcat6
JAXWS with Frontend CXF API vs WSDL top down approach
JDK and web service, and other tools (questions from dummy)
SOAP message to XML