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?

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...

Here's the debug dump from the call...


---GOT---
HTTP/1.0 200 OK
Server: Helma XML-RPC 1.0
Connection: close
Content-Type: text/xml
Content-Length: 287

<?xml version="1.0"
encoding="ISO-8859-1"?><methodResponse><fault><value><struct><member><name>faultString</name><value>java.lang.NoSuchMethodException:
fetchInfo</value></member><member><name>faultCode</name><value><int>0</int></value></member></struct></value></fault></methodResponse>
---END---

---EVALING---[157 chars]---
new xmlrpcval(array('faultString' => new
xmlrpcval("java.lang.NoSuchMethodException: fetchInfo",
'string'),'faultCode' => new xmlrpcval(0, 'int')), 'struct');
---END---


------------------.--------.
Dave Belfer-Shevett\ KB1FWR \
www.homeport.org    >--------`------------------------------------
[EMAIL PROTECTED]  / Light travels faster than sound. This is why \
------------------<    some people appear bright until you hear    |
                  |                  them speak                    |
                   \______________________________________________/


--
For information about how to subscribe and unsubscribe from this list
visit http://xmlrpc.usefulinc.com/list.html

Reply via email to