News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Danne Lundqvist's Blog:
SOAP structures in PHP
November 04, 2008 @ 09:33:14

Danne Lundqvist is frustrated with the SOAP functionality that comes native with PHP on one very specific subject - its handling of SOAP structures.

Handling SOAP structures in PHP can sometimes be really annoying. If an interface is defined in the WSDL as returning an array I can't be sure that I will get an array. If there is only one element in the array PHP tries to be clever and turn the wanted array into an object which, too me, isn't really smart. I don't know if this is a problem/limitation on the client side, server side or if it is just me doing something stupid in the wsdl.

He gives an example of the WSDL that was requested and the differing results from a call that returned one Map item verses several (how the objects were returned). In asking for help, it looks like he got some in the comments - an attribute called SOAP_SINGLE_ELEMENT_ARRAYS that can be added to the configuration array when creating the SoapClient object.

0 comments voice your opinion now!
soap structure wsdl inconsistent soapsingleelementarrays soapclient php5


Eirik Hoem's Blog:
Array problems with SOAP and PHP - Updated
March 13, 2008 @ 10:22:19

Eirik Hoem has posted an update on a previous problem he was having when working with SOAP in PHP and its handling of arrays.

The scenario was that when an array with only one object was returned over SOAP the array was discarded and pointed straight to the single object.

Come to find out, this behavior wasn't a bug, it was a feature - the fix is to add another parameter to the initialization of the SoapClient to add the SOAP_SINGLE_ELEMENT_ARRAYS feature.

0 comments voice your opinion now!
soap gotcha array problem soapsingleelementarrays feature bug



Community Events





Don't see your event here?
Let us know!


interview podcast list version tips code laravel deployment release development series community conference api application introduction framework developer zendserver language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework