PHP, SOAP and operation signatures

After investigating SOAP further there seems to be a common confusion regarding the difference between rpc/literal and document/literal and how it is handled in PHP. There is even a bug 49169 reported because PHP ext/soap maps all operations defined in the web service with the same signature to the first defined function or method in PHP when using document/literal style.

It is not a bug. The style document/literal is for sending messages with document data. It is not a remote procedure call. For that we have rpc/literal. So if you look at it that way it is completely understandable that only one method should be around to handle one specific type of message (document).

It is also completely correct behaviour according to the specification WS-I Basic Profile.

“In the case of rpc-literal binding, the operation name is used as a wrapper for the part accessors. In the document-literal case, since a wrapper with the operation name is not present, the message signatures must be correctly designed so that they meet this requirement.

As document/literal is the preferred style, and some implementations obviously have a tendency to dislike rpc/literal, a lot of people is going down the document/literal route without understanding the implications and what the real difference really is.

I don’t think this should stop ext/soap in PHP to use the soapAction header for routing when necessary. According to WSDL 1.1 the soapAction attribute is mandatory when HTTP protocol binding is used. Whether rpc/literal or dcoument/literal style is used is of no difference. So is this information just garbage for document style messages?

Anyways, PHP bug 46169 is to my understanding not really a bug. But it is a reasonable feature request.

PHP

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

2 Responses to “PHP, SOAP and operation signatures”

Trackbacks

Check out what others are saying about this post...
  1. [...] PHP, SOAP and operation signatures – Danne Lundqvist  Leave a [...]



Leave Comment

(required)

(required)