I'm getting this error:
The element 'Request_Distribution' in namespace 'Web.WS.ExternalGateway' has invalid child element 'Occupation' in namespace 'Web.WS.ExternalGateway'. List of possible elements expected: 'Occupation' in namespace 'Web.WS.Interfaces'. |
The problem is that my XML generated file is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns6623="http://testuri.com">
<SOAP-ENV:Body>
<Distribucion_Distribution xmlns="Web.WS.ExternalGateway">
<Request_Distribution>
<Occupation>
<Passengers>
<Total>3</Total>
<NumAdults>2</NumAdults>
<NumChildren>1</NumChildren>
<NumBabies>0</NumBabies>
</Passengers>
<Vehicles>
<Total>3</Total>
<NumAutos>0</NumAutos>
<NumTrailers>0</NumTrailers>
<NumMotorbikes>0</NumMotorbikes>
</Vehicles>
<NumPets>0</NumPets>
</Occupation>
</Request_Distribution>
</Distribucion_Distribution>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> |
But 'Occoupation' tag is defined in 'Web.WS.Interfaces' and its tag should look like that:
<Occupation xmlns="Web.WS.Interfaces"> |
Here is my code:
$url_servicio = 'http://195.53.86.14:8083/Distribution.asmx?wsdl';
require_once('nusoap/nusoap.php');
$param = array(
'Request_Distribution' => array(
'Occupation' => array(
'NumPets'=>'0',
'Passengers' => array('Total'=>'3', 'NumAdults'=>'2', 'NumChildren'=>'1','NumBabies'=>'0'),
'Vehicles' => array('total'=>'0', 'NumAutos'=>'0', 'NumTrailers'=>'0', 'NumMotorbikes'=>'0')
)
)
);
$client = new nusoap_client($url_servicio, true);
$proxy = $client->getProxy();
$response = $proxy->Distribucion_Distribution($param, false,1 );
|
So, my question is: How do I make 'Occcupation' to look like:
<Occupation xmlns="Web.WS.Interfaces"> |
I've tried with soapval but it doesn't work either.