S.Richmond
S.Richmond

Reputation: 11558

XMLRPC - Python Server, PHP Client. No consistancy?

I'm currently trying to build a web-base management interface for a cluster of linux servers running a special service. The idea being that the management website can RPC the clusters to gather information, perform configuration tasks, etc.

I've got an XMLRPC Python Server script up and running, and I've written a basic XMLRPC Client in PHP. It all works, but I'm having some serious issues trying to get consistent responses from method calls - Sometimes I get an XML array to n'th depth based on the verbosity of the output of the command I run, sometimes its a XML struct, and sometimes its just a plain old value. Then I've got errors to deal with - It seems the XMLRPC standard has a Fault struct with 'faultCode' and 'faultString' values it responds with, which is great because thats tidy and I can pull that data out via the named key in the XML. But you only get that struct if error is from the shell itself (For example if the called command had a bad argument), whereas an error coming from the command has to be just a normal XML response.

How can I possibly write a robust web-service around what appears to be such varied replies from the XMLRPC server? What I'd really like to do is have the exact same XML struct reply back every time with the same Keys (returnCode (0=success, >1=error), returnValue/s).

Thanks for any advice.

Upvotes: 1

Views: 844

Answers (1)

Lars Strojny
Lars Strojny

Reputation: 665

Maybe start with an existing XML/RPC client and let the client do the protocol legwork. There is Zend\XmlRpc in Zend Framework but also standalone clients like fxmlrpc.

Upvotes: 1

Related Questions