Comparing Hello World

Friday, February 1, 2008

I posted Hello World Services and Hello World Clients with PHP SOAP extension, NuSOAP and WSF/PHP.

NuSOAP looks the most clean, with its natural mapping for PHP types to service request/response serialization. Native SOAP extension again can deal with PHP types, but there are problems when it comes to customizing element names the way we wish.

WSF/PHP code looks more bulky, because of the XML in-out model. However it has the advantage of being able to control the payload the way we wish.

The key point is that, as far as the API is concerned, the three alternatives are not that much apart. They look almost the same. For a service, you define a function and declare that function to be an operation of the service. For a client, you provide the service endpoint and send the request with the required parameters.

One thing to note with SOAP extension and NuSOAP is that you have to register the operations one by one. For small services this is fine. But if you have 5, 10 operations, this would mean multiple calls. With WSF/PHP, you can provide an array of operations.

Anyway, the bottom line is, all three are usable simple for the simple cases.

I would like to visit WS-Addressing with PHP in the near future and see how these Web services framework would support that spec.

No comments: