Sample - PHP

Web Service

Connecting to the Web Service from PHP can be accomplished using the SoapClient class included with PHP version 5 and later:

$sc = new SoapClient('https://ws.textanywhere.net/ta_SMS.asmx?wsdl'); $params = new stdClass(); $params->Client_ID = 'my_id'; $params->Client_Pass = 'my_pass'; $params->Client_Ref = 'my_ref'; $params->Billing_Ref = 'billing_ref'; $params->Connection = '2'; $params->Originator = '+447912345678'; $params->OType = '0'; $params->DestinationEx = '+447923456789'; $params->Body = 'hello world'; $params->SMS_Type = '0'; $params->Reply_Type = '0'; $params->Reply_Data = ''; $result = $sc->__call('SendSMSEx', array($params)); echo $result->SendSMSExResult;

You can call any of the Web Service methods in a similar manner. When using different methods be sure to change the highlighted text to match the name of the method you are calling. You can specify a proxy server if required:

$proxy = array( 'proxy_host' => 'my.proxy.host', 'proxy_port' => '8080', 'proxy_login' => 'myproxyusername', 'proxy_password' => 'myproxypassword'); $sc = new SoapClient('https://ws.textanywhere.net/ta_SMS.asmx?wsdl', $proxy);

Footer Bottom