Passing array of objects in SOAP



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

.



Relevant Pages

  • Passing array of objects in SOAP
    ... I can't find out how to send an array of objects with the built in SOAP ... $id = new GuidVO(); ... $ids = array; ...
    (comp.lang.php)
  • Problem when switching from SoapClient to WebServicesClientProtocol
    ... I have a working C# class library that acts as a soap client. ... over the formatting of the soap body: ... It all boils down to the "this.invoke" method requiring an object array ... //populate the test widgets array ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: How to do: Web Services returning a class that inherits arrayl
    ... Array types can be defined in the soap schema. ... I have a class called CartLine and I try to return this class in a Web ... The proxy reference doesn't contain any information even though I use the ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Apache Axis - Soap
    ... I have read some tutorial to Soap, but I dont get the point. ... My "simple" Problem is to turn the XML Soap Document into an Array ...
    (comp.lang.java.programmer)
  • Re: Different SOAP Requests vs
    ... is sending is different then what the service is expecting. ... Soap bug as i found others with issues so you have to use the ... $params = array( ... The issue is that the service its being sent to doesn't like tags ...
    (comp.lang.php)