Payload Problems? WSF/PHP to the Rescue!

Thursday, January 31, 2008

I am seeing numerous users having payload problems with native SOAP extension and NuSOAP, specially when inter-operating with heterogeneous systems.

The best solution is to use WSF/PHP, the Web services framework with XML in-out model in the heart of its implementation, thanks to Apache Axis2/C.

As PHP users, we would be comfortable working with our own data types such as arrays and classes, and let the SOAP engine handle the serialization completely. WSF/PHP is gradually going there. However, in the mean time, if you run into XML request format problems with other implementations such as .NET, Java, etc. you can always use XML mode.

If you consider native PHP SOAP extension, there is no way to trap the XML payload and manipulate it, and some of the serialization behaviors could not be fine tuned at all. But with WSF/PHP, you can, and it is also written in C. So you have the speed that you want over NuSOAP. I have seen users asking on tweaking XML payload format with NuSOAP as well.


Dorthe said...

Today I had a closer look at the framework because I am looking for a ws-i-compatible PHP soap extension that also supports "doc/lit wrapped" (and those "advanced" ws*-functions are also attractive, you never know what's requested in the future :-) ).

But what I really don't understand is this Build-your-own-XML-Messages by hand-concept. From my point of view this is one of the most important tasks of an SOAP extension that it handles the serialization in a proper way. And the framework knows what a proper way is, the developper often does not know the technical details of webservice communication in detail. I don't aggree to the argumentation that it's better to give full control over the xml-payload to the programmer. It would be nice to have control as an option, but as a standard the extension should serialize and deserialze my parameters.

I read that someday this is planned for the framework. Is this just an idea or is someone already working on this feature? Any comments on this comment are highly appreciated! :-)

Dimuthu said...

Hi dorthe,
We already have doc/lit wrapped WSDL support.
As you told in your comment, Although the XML is very much human readable format, users expect to deal with familiar php types and framework to handle the xml building parsing aspects.

Anyway WSF/PHP is improving these capabilities in addition to the WS* support. Here is my recent blog about these features with some code samples of using them.

Dorthe said...

Dimuthu, thanx for this helpful comment. :-) I looked through the manual of wsf/PHP 1.2 and did not find it there (maybe I just overlooked it, but as I remember the manual just tells that this feature is planned for the future somewhen).

Where can I find more information which data types the non-XML-mode supports in detail?

Dimuthu said...

Hi Dorthe,

WSDL support in the WSF/PHP 1.2 is documented in here.

And the WSDL generation API documentation for 1.2 can be found here That has mention of the available PHP types to xsd:type map too.