php - Cannot receive any SMS messages when I register/ inquire via SMS Globe Labs API -
i developing sms based registration system , far i'm @ stage of testing system. of sudden, not able receive messages server when tried register via sms must receive confirmation messages. here's did when using php nusoap.
register.php
<?php // allow user register via sms. error_reporting( e_all ); // load nusoap libraries. these slower built in php5 require_once('nusoap.php'); // create client , define url endpoint $soapclient = new nusoap_client('http://www.mnccyf.info/soap_book.php?wsdl'); // set character encoding, utf-8 standard. $soapclient->soap_defencoding = 'utf-8'; $soapclient->call('sendsms', array( 'uname' => '48dwi5', 'upin' => '159597', 'msisdn' => '09152886810', 'messagestring' => 'registered successfully', 'display' => '1', 'udh' => '', 'mwi' => '', 'coding' => '0' ), "http://escplatform/xsd"); ?>
inquiry.php
<?php // allow user inquire latest news within organization. error_reporting( e_all ); // load nusoap libraries. these slower built in php5 require_once('nusoap.php'); $soapclient = new nusoap_client('http://www.mnccyf.info/soapquery_server.php?wsdl'); // set character encoding, utf-8 standard. $soapclient->soap_defencoding = 'utf-8'; // call soap method, note definition of xmlnamespace third in call , how posted message added message string $soapclient->call('sendsms', array( 'uname' => '48dwi5', 'upin' => '159597', 'msisdn' => '09152886810', 'messagestring' => 'summer camp 2013', 'display' => '1', 'udh' => '', 'mwi' => '', 'coding' => '0' ), "http://escplatform/xsd"); ?>
incoming_sms.php
<?php require_once('nusoap.php'); function sendsms($number,$soapclient) { $x=sendsms("09152886810",$soapclient); } # load xml string input $xml = simplexml_load_file('php://input'); # parse xml parameters $sms = array(); $nodes = $xml->xpath('/message/param'); foreach($nodes $node) { $param = (array) $node; $sms[$param['name']] = $param['value']; } if($sms['messagetype'] == 'sms-notification') { sendsms(); list($action, $messagetype, $source, $type) =explode (" ",$soapclient); }elseif($sms['messagetype'] == 'sms') { sendsms(); list($action, $name, $age, $localchurch, $district) = explode(" ",$soapclient); }elseif($sms['messagetype'] == 'sms') { sendsms(); list($action, $event,$location,$time) = explode(" ", $soapclient); } else { echo "unsupported message type"; } ?>
register_soapserver.php
<?php //call library require_once ('nusoap.php'); //using soap_server create server object $server = new nusoap_server; $server ->configurewsdl('http://iplaypen.globelabs.com.ph:1881/axis2/services/platform? wsdl','urn:http://iplaypen.globelabs.com.ph:1881/axis2/services/platform?wsdl'); //register function works on server $server->register('reg'); // create function function reg() { $connect = mysql_connect("localhost","root","jya0312@"); if (!$connect) { die("couldnt connect" . mysql_error()); } mysql_select_db("cyfdb", $connect); $sql = "insert mydb(name, age,localchurch,district) values ('{$_post [name]}','{$_post[age]}','{$_post[localchurch]}','{$_post[district]}')"; mysql_close($connect); } // create http listener $server->service($http_raw_post_data); exit(); ?>
soapquery_server.php
<?php //call libraryrequire_once ('nusoap.php'); //using soap_server create server object $server = new nusoap_server; $server ->configurewsdl('http://iplaypen.globelabs.com.ph:1881/axis2/services/platform? wsdl','urn:http://iplaypen.globelabs.com.ph:1881/axis2/services/platform? wsdl'); //register function works on server $server->register('getquery'); // create function function getquery() { $link=mysql_connect("localhost", "root", "jya0312@") or die("cannot connect db!"); mysql_select_db("cyfdb") or die("cannot select db!"); $sql = "select event,location,time activity"; while($r = mysql_fetch_array($sql)){ $items[] = array('event'=>$r['event'], 'location'=>$r['location'], 'date'=>$r['date']); } return $items; $mysql_close($link); } // create http listener $server->service($http_raw_post_data); exit(); ?>
Comments
Post a Comment