0

I am writing a web service client in PHP. web service is developed ij java using axis. Client proxy is generated using wsdl2php tool. Proxy code include 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.

neubert
  • 15,947
  • 24
  • 120
  • 212
Tausif Baber
  • 500
  • 2
  • 8
  • 23

1 Answers1

2

Apparently there is no solution for such kind of data type conversions, or at least i am not aware of this datatype. try to use standard data types such as string, if you have access to the host web service

  • yes i have already asked for the change of datatype to string value and that seems to be the most appropriate solution. – Tausif Baber Sep 20 '11 at 14:05