Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XmlRpc Client/Server Compatibility

Status
Not open for further replies.

gregarican

IS-IT--Management
Jan 31, 2002
469
US
I have an external xmlrpc server that's implemented in Ruby. My other client apps coded in Python, Ruby, and Smalltalk can communicate with it fine. My Java app (which utilizes Apache's xmlrpc 1.0) cannot parse the returned xml results sent from the server, however. Rather than rewrite the server using Apache's xmlrpc 1.0 Java implementation I would like to get the Java client end aligned with the rest of my environment.

Viewing the traffic being sent back and forth using Ethereal I see that the Ruby xmlrpc server is sending back results in the following format using a test method call:

<?xml version="1.0" ?>
<methodResponse>
<params>
<param>
<value>
<string>foo
</string>
</value>
</param>
</params>
</methodResponse>

Here is the response being sent back from a test xmlrpc server I created using Apache's xmlrpc 1.0 implementation:

<?xml version="1.0" ?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>foo
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>


Both test method calls coming from the client were identically coded. It's the server that's returning different results depending on whether or not it's implemented in Ruby or in Apache's xmlrpc 1.0 Java implementation. Is there a way that I can use an alternative content handler on the Java xmlrpc client end so that I can hook into the Ruby xmlrpc server? This server is based on Electric XML and is called REXML.
 
For anyone who is interested there appears to be a bug in some of the
Java XML-RPC implementations. Or at least a different in that it breaks
certain functionality found in other language's XML-RPC
implementations. The issue that I saw with this SuperWaba XML-RPC
implementation ( appears to stem from
the Apache XML-RPC 1.0 library it's based on. See
for details. In
short an XML-RPC response that is passed long with the
<array><data><value> structure isn't being parsed correctly. The <data>
tag isn't being interpreted.

Trying a J2ME Midp4Palm1.0 alternative I brought in kXML-RPC
( and ran into similar issues. It wasn't
until I added the <data> tag into the source code that the test cases I
coded actually worked. See
for
details.


I know this is all a needle in a haystack, but in case anyone goes
through similar problems trying to get some of the Java XML-RPC
implementations to talk to other non-Java XML-RPC servers this might be
of some aid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top