Hi,
I am trying to establish connection with a webservice using NuSOAP. The webservice has a web method called GetShipmentInfoByTrackingNumber(). I am provided a sample SOAP request to this web method below, and I do not know how to make such request using NuSOAP!
Quote: |
POST /IPStracking.asmx HTTP/1.1
Host: wsuat.g4si.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<G4SIAuthentication xmlns="http://tempuri.org/">
<Username>string</Username>
<Password>string</Password>
<AccessKey>string</AccessKey>
</G4SIAuthentication>
<ShipmentTrackingRequest xmlns="http://tempuri.org/">
<TrackingNumber>string</TrackingNumber>
</ShipmentTrackingRequest>
</soap12:Header>
<soap12:Body>
<GetShipmentInfoByTrackingNumber xmlns="http://tempuri.org/" />
</soap12:Body>
</soap12:Envelope> |
I tried these codes:
Quote: |
$soapClient = new nusoap_client("https://wsuat.g4si.com/IPStracking.asmx?wsdl", true);
$soapClient->setCredentials('username','password','basic',array('AccessKey'=>'xxxxx'));
$parameters = array('TrackingNumber'=>'string');
$result = ($soapClient->call("GetShipmentInfoByTrackingNumber", $parameters)); |
It returned some general error: "Object reference not set to an instance of an object.".
Any advice will be appreciated!
Thank you!