I have problem with the call to a method of a WebServer that requires three parameters of type String and another that is a sub-element that has another three parameters. I pass everything as a multidimensional array but it does not work. In the structure sent to the webserver by SOAPClient, it does not add the multi-destination array, it only keeps the first two parameters.
CODE PHP EXAMPLE SOAP:
$ws = new \SoapClient($this->getWSUrl()
,[
'trace'=>true,
'soap_version'=>SOAP_1_2,
'encoding'=>'utf-8',
'connection_timeout'=>'10',
'cache_wsdl'=> WSDL_CACHE_NONE,
]);
$parameters = array(
'token' => 'xxxxxx',
'usuario' => 'xxxxxxx',
'archivo' => array(
'fileType' => 'text/xml',
'nombre' => 'test.xml',
'xml' => 'PD94bW..xxxxxxxxxx.0dWQ+'
)
);
$ws->MyFunctionInWebServer($parameters);
echo $ws->__getLastRequest();
The XML generated by SOAP is the following and it is wrong because it does not have the element "archivo"
OUT Request SOAP:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://xxxxxxxxxxx.xxx/">
<env:Body>
<ns1:enviarSolicitud>
<token>xxxxxxxx</token>
<usuario>xxxxxx</usuario>
</ns1:enviarSolicitud>
</env:Body>
</env:Envelope>
When the Request would have to be:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://xxxxxxxxxxx.xxx/">
<env:Body>
<ns1:enviarSolicitud>
<token>xxxxxxxx</token>
<usuario>xxxxxx</usuario>
<archivo>
<fileType>text/xml</fileType>
<nombre>test_21.xml</nombre>
<xml>PD94xxxxxx0dWQ+</xml>
</archivo>
</ns1:enviarSolicitud>
</env:Body>
</env:Envelope>
You can pass that type by SOAPClient..???