You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by david garry <da...@nomos-software.com> on 2011/08/19 12:43:49 UTC
apachesoap:Element[] from php
Hi there,
I've developed a web service using axis. I've enclosed my entire WSDL in the
above attachement.
The problem I have is developing a client using php to use the
apachesoap:Element[] type.
(From attached WSDL)
<complexType name="ArrayOf_apachesoap_Element">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="apachesoap:Element[]" />
</restriction>
</complexContent>
</complexType>
I generate a client proxy using wsdl2php tool.. Proxy code includes the
following code
class ValidateDetails
{
public $elements; // ArrayOf_apachesoap_Element
public $pipeName; // string
}
and the parameters are set and service is called using the following code
$xml = '<elements> <some xml here /> </elements>';
$xmlElement = new DOMElement('elements', $xml, '');
$details = new ValidateDetails();
$details->elements[0] = $xmlElement;
$details->pipeName = 'mypipe';
$response = new ValidationResult();
$response = $client->validate($details);
However the SoapRequest object does not contain the nested xml inside the
element node.
It looks like this
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://build.nomos.com"
xmlns:ns2="http://xml.apache.org/xml-soap"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns3="urn:CompilationService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:validate>
<details xsi:type="ns3:ValidateDetails">
<elements
SOAP-ENC:arrayType="ns2:Element[1]"
xsi:type="ns3:ArrayOf_apachesoap_Element">
<item xsi:type="SOAP-ENC:Struct"/>
</elements>
<pipeName
xsi:type="xsd:string">mypipe</pipeName>
</details>
</ns1:validate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I am unable to understand how to populate the elements field with the
correct xml.
Please suggest what is this ArrayOf_apachesoap_Element datatype and how can
I populate this parameter.
Best regards
David