You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Chris McKay <ch...@defacto.com.au> on 2006/05/10 12:13:56 UTC

RE: No string type wrapping

For those of you who need to talk to a XML-RPC server that doesn't like the
lack of <string>...</string> tags, specifications be damned. It's a pretty
easy fix.

C

>From xml-rpc v2.0 source
At Line 225 in org/apache/xmlrpc/XmlWriter.java:

    public void writeObject(Object obj)
        throws XmlRpcException, IOException
    {
        startElement("value");
        if (obj == null)
        {
            throw new XmlRpcException
                (0, "null values not supported by XML-RPC");
        }
        else if (obj instanceof String)
        {
           startElement("string");
           chardata(obj.toString());
           endElement("string");
        }
        else if (typeDecoder.isXmlRpcI4(obj))



Re: No string type wrapping

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 5/10/06, Chris McKay <ch...@defacto.com.au> wrote:

> For those of you who need to talk to a XML-RPC server that doesn't like the
> lack of <string>...</string> tags, specifications be damned. It's a pretty
> easy fix.

As this special feature seems to be requested frequently: I have made
the XmlWriter public in the SVN branch of version 2. Also, I have
added an FAQ entry that demonstrates how to get "string" tags by
subclassing the XmlRpcClient. Which is, IMO, a much preferrable
solution over patching.


Jochen

--
Whenever you find yourself on the side of the
majority, it is time to pause and reflect.
(Mark Twain)