aspose file tools*
The moose likes Web Services and the fly likes Doubt with Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Doubt with Web Service" Watch "Doubt with Web Service" New topic
Author

Doubt with Web Service

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

All i needed to do is accessing an API by sending XML request and get XML response.

To do this, do i need to create a Service class which forms the XML input to be passed and get the response.

Or simply with the Client code, can i do the same. Sorry if its such a lame question but i need to know a bit about that. So guys please help me

I am using Spring + CXF


Never try to be a hard-worker. Be a smart-worker.
My Blog
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
You can very well do it in client code. And your understanding about service class or generally we call them stub is correct. They are used mainly to automatically generate request xml based on the parameters you pass.


SCJP 1.5(97%) My Blog
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

So a stub/service to pass the XML request, and the client to get the XML response and parse it. Is that so? Am i right?

So to form a XML request & parse it, i need to use JAXB?
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
stub will be do both i.e. generating xml request and parsing the response. stub itself may use JAXB to do that. And JAXB is one of the data mapping technology, there are other as well.
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

^^ Thanks for the answer. From what i understand,

I can have stub/service to handle all my web service processing and connect to it using the controller in Spring and display the details in the view.

Whether i use RESTlet or CXF? Its a REST based Web Service.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Rajkumar balakrishnan wrote:Whether i use RESTlet or CXF? Its a REST based Web Service.

Personally, I would use CXF if I were deploying to a container, like Tomcat, and RESTlet if I were developing a stand-alone server.
However, RESTlet services can also be deployed to a container, so in the end it may be a question of personal preferences.
JBoss RESTEasy has a client API that is supposed to make it possible to develop clients of RESTful web services in a manner similar to developing RESTful web services with JAX-RS, that is by using annotations.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

^^

Thanks friend. I personally suggest RESTlet as it was real easy and project deadline is too short. But hey, i didnt heard about RESTEasy and will sure give it a shot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt with Web Service