• 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

Creating a webservice using XML over HTTP.

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My client has a requirement, which involves a call to my webservice. Here, he does not want to send the messages in SOAP envelop. Instead he intends to send simple XML over HTTP. Now, I googled and found out that REST is a kind of webservice, which uses simple XML over HTTP, and does not require any SOAP envelope around.
My questions :
1:- Does REST implementation supports XML request and response as :

<ABCResponse>

<ResponseCode>0000</ResponseCode>

<TestType>SVC
<TestNumber>6732788883456</TestNumber>
</TestType>

</ABCResponse>

2:- Will REST be the right choice considering XML over HTTP, but no SOAP?

3:- Any good tutorial link, with Client and Service, implementing REST.

4:- Can a we create a WSDL out of the REST service implementation?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
0. Don't be so impatient
1. RESTful services support any input or output you care to use, thats the whole point of sticking to the basic HTTP methods. However, XML and JSON are very common.
2. For XML and not SOAP you can go back to XML-RPC Apache open source version. XML-RPC is like the ancestor of SOAP.
3. See the Jersey site for loads of examples
4. In Theory, you can create WSDL for a RESTful service but I think that is a Kludge.

Bill
 
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!
XML over HTTP is not necessarily REST - those are not interchangeable terms.
However, this certainly won't stop you from developing a XML-over-HTTP web service. It is even possible to do this using JAX-WS, so you do not have to rely on some obscure framework - everything is there for you in Java SE 6. Let me know if you want an example.
A very good article about RESTful web services that I suggest you read if you are thinking about developing something like that:
http://www.jroller.com/rickard/entry/the_domain_model_as_rest
Best wishes!
 
lekurwale amol
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William :
0 : Sorry..for being impatient.
1 : ok
2 : "XML-RPC is like the ancestor of SOAP" I tried the sample application on the link..Could deploy and run. My query is, is there any way 'see' the xml request's and responses exchanged?(No tools download please, I cant install any more)

Ivan :
" It is even possible to do this using JAX-WS" . What I read was that JAX-WS uses SOAP protocol to exchange information. Am I right? If not, then is it a simple xml exchange over HTTP?

Also
"XML over HTTP is not necessarily REST".. can you give an idea of other protocols, excluding SOAP or as William suggested XML-RPC?

And, as you said, can you provide the example of JAX-WS

-Amol
 
Ivan Krizsan
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!

lekurwale amol wrote:What I read was that JAX-WS uses SOAP protocol to exchange information. Am I right?


JAX-WS does not have to use SOAP. Take a look at section 9.4 in my SCDJWS 5 study notes book here: http://www.slideshare.net/krizsan/scdjws-5-study-notes-3085287
It shows a complete example on how to develop a XML-over-HTTP (no SOAP) web service with JAX-WS.

"XML over HTTP is not necessarily REST".. can you give an idea of other protocols, excluding SOAP or as William suggested XML-RPC?


REST is not a protocol, but an architectural style. Read about it here: http://en.wikipedia.org/wiki/Representational_State_Transfer
If you, for instance, remove one of the constraints, then, as far as I am concerned, you no longer have REST, but perhaps XML-over-HTTP.
Again, read the article I recommended in the previous post. I feel that very few people have really understood what REST really is about and the majority of what is claimed to be RESTful web services really are nothing more than XML-over-HTTP or JSON-over-HTTP web services. While this is perfectly fine, I feel it is inappropriate to call them RESTful web services.
Best wishes!
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only way to capture the complete request and response text just has to be a tool such as TCPMON, but don't worry, this is not some complex monstrosity and won't take much learning curve.

Something like TCPMON is a good thing to have in your toolbox if you are going to be working with web services.

Bill
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi William,
Good that you mentioned about TCPMON. Is this something similar to Fiddler and WireShark? If so, any extra advantages of TCPMON over the ones I mentioned?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic