NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Nusoap and namespaces for child items


Joined: 12 Feb 2008
Posts: 1
Reply with quote
I'm getting this error:

Code:
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:

Code:
<?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:

Code:
<Occupation xmlns="Web.WS.Interfaces">


Here is my code:

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:

Code:
<Occupation xmlns="Web.WS.Interfaces">


I've tried with soapval but it doesn't work either.
View user's profileFind all posts by gorkauSend private message
Nusoap and namespaces for child items
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic