NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
more than one namespace for XML


Joined: 01 Aug 2010
Posts: 2
Reply with quote
I am trying to use nusoap to interact with a webservice that has been implemented using SOAP messaging.

I need an authentication section in the header and in the body the XML that needs to be sent...

I am trying to produce something like this.

Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xhi="http://www.venere.com/XHI"
xmlns:ns="http://www.opentravel.org/OTA/2003/05">
<soapenv:Header>
<xhi:Authentication>
<xhi:UserOrgID>acme</xhi:UserOrgID>
<xhi:UserID>john.doe</xhi:UserID>
<xhi:UserPSW>x1y4K8z4</xhi:UserPSW>
</xhi:Authentication>
</soapenv:Header>
<soapenv:Body>
<ns:OTA_PingRQ EchoToken="A01256" Target="Production" Version="1.004">
<ns:EchoData>Hello</ns:EchoData>
</ns:OTA_PingRQ>
</soapenv:Body>
</soapenv:Envelope>


I am able to use the wsdl file supplied with the web service and after executing the following I get close to where I need to be...

Code:


$temp = '<?xml version="1.0" encoding="utf-8" ?><ota:OTA_PingRQ EchoToken="A01256" Target="Production" Version="1.004"><ota:EchoData>Hello</ota:EchoData></ota:OTA_PingRQ>';


$client = new nusoap_client('file://'.ALLOTZ_PATH_ROOT.'/cron/REST/php/translators/venere/wsdl/OTA_Ping.wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
   
$result = $client->call('OTA_Ping_Request', $temp, 'http://www.venere.com/XHI', false, false, false, 'document');


However the problem is that the service gives the response org.xml.sax.SAXParseException: The prefix "ota" for element "ota:OTA_PingRQ" is not bound. as I can't get 2 name-spaces present in the initial envelope as required like this..

Code:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xhi="http://www.venere.com/XHI"
xmlns:ns="http://www.opentravel.org/OTA/2003/05">



Is there a way to do this easily in nusoap?
View user's profileFind all posts by foftoogsSend private message


Joined: 01 Aug 2010
Posts: 2
Reply with quote
ah yeah right.. I will answer my own question here :S

I just didn't add the namespace to the OTA XML message Embarassed
View user's profileFind all posts by foftoogsSend private message
more than one namespace for XML
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