GeeCON Prague 2014*
The moose likes Web Services and the fly likes returning XML using XML-RPC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "returning XML using XML-RPC" Watch "returning XML using XML-RPC" New topic
Author

returning XML using XML-RPC

Mike(work) Warren
Greenhorn

Joined: Jul 24, 2003
Posts: 3
Hi ,
I'm thinking of writing a webservice to return an XML document using XML-RPC.
I've done a bit of experimenting and it seems to work ok, using a XML-RPC's string type to return the XML.
However as I'm new to XML and webservices I'm not sure if this is a reasonable thing to be doing - I'd be interested to hear any opinions.
Thanks - Mike
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
String works fine and is about the simplest approach.
Bill
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Agree with Bill but....

Exchanging String objects, you're gonna use RPC/Encoded. This communication model is strongly discouraged by WS-I.
So if you want to be WS-I compliant, I guess you'll have to use a LITERAL Encoding.
According to Sun, if you want to exchange XML, you must use a javax.xml.transform.Source Object.

But String is simpler, and it does work.


/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Mike(work) Warren
Greenhorn

Joined: Jul 24, 2003
Posts: 3
OK - Thanks for the replies.
I think I'll stick with using XML-RPC and returning a String for now, and research other options later when I've got a better understanding of the issues involved
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Jean-Louis Marechaux:
Agree with Bill but....
Exchanging String objects, you're gonna use RPC/Encoded. This communication model is strongly discouraged by WS-I.
So if you want to be WS-I compliant, I guess you'll have to use a LITERAL Encoding.

I'm using Aapche Axis 1.1, its NOT fully suitable for document/literal service.


Spritle Software Blogs
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Originally posted by Balaji Loganathan:

I'm using Aapche Axis 1.1, its NOT fully suitable for document/literal service.

I'm using Apache SOAP and it is not fully suitable for DOC/LIT either. But I can fake doc/lit using RPC/LIT and exchanging XML documents through org.w3c.dom.Element .
As for Axis 1.1, I'm a bit surprised about your statement. Can you explain further ?? Axis is supposed to be JAX-RPC compliant. What are the problems you are facing with DOC/LIT
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
hi Jean
Yes!.. I'm sure!.. I'm using axis 1.1(final version).
Axis1.1 is not fully capable for doc/lit service even for methods which returns string as output.
Four problems
1. See the bug with my comments inline http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18714
2. and here http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21687
3. I had a chance to use microsoft infopath which has the utility to consume doc/lit based web services,but when i try to use them to consume axis services, i'm getting the error at soap response.The same works fine with .NET as server
4. I also tried to consume this service using .NET web service studio tool 2.0 and with JSP/servlet. The SOAP response returned values were read as null.
So!.. doc/lit is not so stable.
[ July 25, 2003: Message edited by: Balaji Loganathan ]
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Very interesting Balaji.
Thanks for the input, I'll keep that in mind.
 
GeeCON Prague 2014
 
subject: returning XML using XML-RPC