Bridging PHP and .NET with XML-RPC

Bridging PHP and .NET with XML-RPC. A couple of months ago, I mentioned that we are developing rich Windows clients running on .NET. We are still using PHP on the web server, and using XML-RPC for communication between .NET and PHP. We could have tried to use SOAP, but at that time there were too many deficiencies in NuSOAP's support of arrays and collections.

We used the following XML-RPC libraries: Keith Deven's for PHP, and the Cook Computing library for .NET. It turned out to be very simple to get everything working. The docs were clear, and with half a day of coding, we got basic connectivity up.

We've been happy using Keith Deven's PHP library, but recently we decided to test using the epinions xmlrpc extension that comes bundled with PHP. We thought it would be significantly faster as it was coded in C. To our surprise, it made very little difference to performance. The improvement in speed was just 1%. The reason is simple: most of the overhead is in the networking, apache processing, and actual computation. The breakdown of time is roughly:

  • 10% testing overhead
  • 50% networking/apache/xml-rpc overhead
  • 40% computation (1 query and 2 updates to Oracle)

Given that the client/server testing was done on a single machine, that 50% networking/apache overhead is quite high. This explains my interest in Nanoweb and simpler alternatives.  [PHP Everywhere]

Leave a comment