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.
<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...
$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..
<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?