On Wed, 2001-12-05 at 14:07, Dave Belfer-Shevett wrote:
> 
> Hi folks.  I'm using the current phpxmlrpc library, and I'm wondering if
> I've misinterpreted something, or if this is just not workign right.
> 
> If I place a call to my xmlrpc server, my process is:
> 
> - create the message via 'new xmlrpcmsg'
> - create the client handle via 'new xmlrpc_client'
> - send it via the 'send()' method
> - check to see if we got -any- result (if not, call failed)
> 
> here's where it gets tricky.  We know we got an xmlrpc message -back-, but
> did the call succeed or not?  What I've been doing is
> 
> if ($r->faultCode()) {
>       echo "Dude, we're hosed: " . $r->faultString();
> }
> 
> But in a recent problem, I changed that to:
> $foo = xmlrpc_decode($r->value();
> echo "faultCode is " . $foo[faultCode] . "<br>";
> echo "faultString is " . $foo[faultString] . "<br>";
> 
> and got:
> 
> faultcode is 0
> faultstring is java.lang.NoSuchMethodException: fetchInfo
> 
> Now, here's the problem(s)
> 
> 1) why are we getting '0' as a faultcode?  That's not a positive, it
> traditionally means 'everything worked'.
> 
> 2) Why didn't $r->faultCode() have '0' in it (it didnt'), and why didn't
> $r->faultString() contain the 'no such method' message?

because xmlrpc_decode only works on the value.
the faultCode is part of the response, not the return value

use the orginal method to detect the fault

> 3) Is this a problem with phpxmlrpc, or with the xmlrpc library I'm using
> on the Java server
> 
> 4) is this actually a -problem-?  I mean, the xmlrpc call -worked- in that
> it contacted another xmlrpc server, asked a question, got a properly
> formatted response back - but the xmlrpc packet back had the fault in it.
> 
> I'm very puzzled.  Help?  My workaround is to embed a decode() in the
> xmlrpc call from php, and check for 'faultString', but that really seems
> cumbersome...
> 

Attachment: msg00066/pgp00000.pgp
Description: PGP signature

Reply via email to