Re: Fault Code data type

John Wilson <[email protected]> Wed, 21 May 2008 21:28:06 +0100
Newsgroups gmane.text.xml.rpc.specification
Message-ID <[email protected]>
On 21 May 2008, at 20:36, jessedp23 wrote:

> Is the data type for a Fault Code always supposed to be a int? The
> spec specifically specifies the value as being an int, but doesn't
> address if that is how it has to be implemented.
>
> <member>
> <name>faultCode</name>
> <value><int>4</int></value>
> </member>
>
>
> I ask b/c I'd like to be able to use a string for my fault code (to
> the class name of an exception that is bubbling up), but don't want to
> break the standard. I did dig into the XML-RPC server I'm using
> (PEAR's XML-RPC2) and found that they were casting the code as an int,
> but after removing their own client library handled the string just  
> fine.
>
> IF it's not a no-no, anyone have any insight into whether I may run
> into problems w/ other various other client libraries not expecting
> (and possibly puking on) a string as the code?
>

The spec says you return an int. If you don't do that you will break  
many client implementations.


John Wilson


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/