|
Posted by systemutvecklare on 01/20/06 15:08
Hi
I can't find out how to send an array of objects with the built in SOAP
in PHP5.
My code looks like this:
****BEGIN CODE****
$id = new GuidVO();
$ids = array($id);
$soap_param = new SoapParam($ids, 'AccountIds');
$soap_params[] = $soap_param;
$server->__soapCall($function, $soap_params, null, $header,
$output_headers);
*****END CODE*****
Part of the soap message produced by the code:
****BEGIN MESSAGE****
<SOAP-ENV:Body>
<ns1:getAccounts>
<in0 SOAP-ENC:arrayType="SOAP-ENC:Struct[1]"
xsi:type="SOAP-ENC:Array">
<item xsi:type="SOAP-ENC:Struct">
<value
xsi:type="xsd:string">749C8C07-FB54-4ED0-8F8F-0D49D2A359D8</value>
</item>
</in0>
</ns1:getAccounts>
</SOAP-ENV:Body>
*****END MESSAGE*****
The problem is that the arrayType is set to Struct. I want it to be set
to GuidVO. I tried to use SoapVar in order to set the arrayType but
apache crashes as a result of a php crash and I can't se the soap
message that would have been sent to the server
****BEGIN CODE****
$id = new GuidVO();
$ids = array($id);
$soapvar = new SoapVar($ids, SOAP_ENC_ARRAY, "GuidVO");
$soap_param = new SoapParam($soapvar, 'AccountIds');
$soap_params[] = $soap_param;
$server->__soapCall($function, $soap_params, null, $header,
$output_headers);
*****END CODE*****
Thanks for any suggestions about sending an array of objects in Soap!
/Andreas
Navigation:
[Reply to this message]
|