php - PHPSoap converts a non-repeatable field into an array in case of multiple occurence -



php - PHPSoap converts a non-repeatable field into an array in case of multiple occurence -

i've defined soap webservice xsd type defining non-repeatable field.

if provide many occurrences of field, expect phpsoap throw exception or wrong, converts array (as expected if repetition allowed).

here extract of xsd part of wsdl :

<xsd:complextype name="orderitem"> <xsd:sequence> <xsd:element type="xsd:string" name="orderid" maxoccurs="1"/> <!-- maxoccurs useless default value 1 suremore ... --> <xsd:element type="xsd:string" name="sku"/> </xsd:sequence> </xsd:complextype>

if send request message, got array behind soap layer (i expected exception) :

<orderitem> <orderid>12345685</orderid> <sku>sku123456</sku> <orderid>12345686</orderid> </orderitem>

here var_dump of orderitem object received :

orderitem::__set_state(array( 'orderid' => array ( 0 => '12345685', 1 => '12345686', ), 'sku' => 'sku123456',

)

is normal ?

php soap

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -