• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt with Web Service

 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
^^ 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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
^^

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic