Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to call this web service http:// 115. 186. 182.11/csws/Service.asmx?op=SendSMS with following PHP code but it gives me exception Error mate in Script: Server was unable to process request. ---> Object reference not set to an instance of an object.

Will highly appreciate your help on this.

try     {       

$client = new SoapClient("http://115.186.182.11/csws/Service.asmx?wsdl"); 

$method = 'SendSMS';

$params = array(
new SoapParam('xxxxx', 'Src_nbr'),
new SoapParam('xxxxxx', 'Password'),
new SoapParam('xxxxx', 'Dst_nbr'),
new SoapParam('xxxxx', 'Mask'),
new SoapParam('Message is test message', 'Message')
);

$result = $client->__call($method,$params);

}
catch(SoapFault $e){
echo "Error mate in Script: " . $e->getMessage();
}

echo "<pre>";
var_dump($result);
echo "</pre>";

$xmlobj = simplexml_load_string($result);
print_r($xmlobj);

FOllowing is the specification...

POST /csws/Service.asmx HTTP/1.1
Host: 115.186.182.11
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/SendBulkSMS"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SendBulkSMS xmlns="http://tempuri.org/">
      <Src_nbr>string</Src_nbr>
      <Password>string</Password>
      <Dst_nbr>xmlxml</Dst_nbr>
      <Mask>string</Mask>
      <Message>string</Message>
    </SendBulkSMS>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SendBulkSMSResponse xmlns="http://tempuri.org/">
      <SendBulkSMSResult>
        <string>string</string>
        <string>string</string>
      </SendBulkSMSResult>
    </SendBulkSMSResponse>
  </soap:Body>
</soap:Envelope>
share|improve this question
add comment (requires an account with 50 reputation)

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.