- Timestamp:
- Nov 11, 2014 9:40:48 PM (11 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/services
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php
r460 r470 17 17 18 18 public function testmo() { 19 $url = 'http://10.58.38.162/violetservice/soanbai/mo'; 20 //$url = 'http://10.58.38.162/services/viettel'; 21 //$url = 'http://viettel.violet.vn/violetservice/soanbai/mo'; 19 $url = 'http://10.58.38.162/violetservice/soanbai/mo?wsdl'; 20 22 21 $aryParams = array( 23 22 'username' => 'sbg', … … 45 44 //$result = $client->call('MOReceiver', $aryParams ,$operator ,$operation); 46 45 47 $err = $client->getError(); 46 echo $client->responseData; 47 48 /* $err = $client->getError(); 48 49 49 50 if ($err) { … … 55 56 echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>"; 56 57 echo "<h2>Response</h2>"; 57 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; 58 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; */ 58 59 } 59 60 … … 102 103 public function topup () 103 104 { 105 $url = $this->config->item('topup_service_url'); 104 106 $operator = 'TopupService'; 105 $operation = 'http:// tempuri.org/ITopupService/TopUp';107 $operation = 'http://soanbaigiang.smas.vn/ITopupService/TopUp'; 106 108 107 109 $username = 'sbg'; … … 123 125 $err = $client->getError(); 124 126 125 if ($err) { 126 echo '<p><b>Error: ' . $err . '</b></p>'; 127 if ($client->fault) { 128 echo "<h2>Fault loi:</h2><pre>"; 129 print_r($result); 130 echo "</pre>"; 127 131 } 128 132 else { 133 $error = $client->getError(); 134 if ($error) { 135 echo "<h2>Error</h2><pre>" . $error . "</pre>"; 136 } 137 else { 138 echo "<h2>Ket Qua</h2><pre>"; 139 var_dump($result); 140 echo "</pre>"; 141 } 142 } 129 143 echo "<br/>"; 130 144 echo "<h2>Request</h2>"; 131 145 echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>"; 132 146 echo "<h2>Response</h2>"; 133 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; 147 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; 148 134 149 } 135 150 -
pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php
r460 r470 9 9 class Viettel extends MX_Controller 10 10 { 11 12 11 function __construct() { 13 12 parent::__construct (); 13 14 14 $this->nusoap_server = new soap_server (); 15 $this->nusoap_server->configureWSDL('messageReceiver', 'urn:messageReceiver'); 16 $this->nusoap_server->soap_defencoding = 'UTF-8'; 15 $this->nusoap_server->configureWSDL('messageReceiverWSDL','urn:messageReceiverWSDL'); 16 17 $this->nusoap_server->soap_defencoding = 'UTF-8'; 17 18 $this->nusoap_server->methodreturnisliteral=TRUE; 18 19 … … 48 49 'info' => 'xsd:string', 49 50 'receiveTime' => 'xsd:string') 50 , array ('return' => 'xsd:string'),false,false 51 ,'rpc' 52 ); 51 , array ('return' => 'xsd:string'), 52 'urn:messageReceiverWSDL',"urn:messageReceiverWSDL#MOReceiver","rpc","encoded"); 53 53 } 54 54 55 function index() { 56 if($this->uri->segment(3) == "wsdl") { 55 public function index () 56 { 57 if($this->uri->segment(4) == "wsdl") { 57 58 $_SERVER['QUERY_STRING'] = "wsdl"; 58 59 } else { 59 60 $_SERVER['QUERY_STRING'] = ""; 60 61 } 61 62 function MOReceiver () { 63 return 'Service not available!'; 64 } 65 66 $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA:''; 67 $this->nusoap_server->service($HTTP_RAW_POST_DATA); 62 $this->nusoap_server->service(file_get_contents("php://input")); 68 63 } 69 64 70 65 public function mo() 71 { 66 { 72 67 function MOReceiver($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $contentType ,$info, $receiveTime){ 73 68 $msgType = '0'; //text message … … 95 90 96 91 $result = $CI->userModel->register ($sentNumber, $receiverID, $serviceID, $commandCode, $info, $receiveTime, $status); 97 $aryAgrs = func_get_args (); 98 $fh = fopen('register.log', 'a+'); 99 fwrite ($fh, var_export($aryAgrs, true). "\n"); 100 fclose($fh); 101 92 102 93 $aryResult = explode ('|', $result); 103 94 -
pro-violet-viettel/sourcecode/application/modules/services/views/topup.php
r457 r470 1 <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/"> 2 <soap:Body> 3 <TopupService xmlns="http://tempuri.org/"> 4 <EWalletID><?php echo $EWalletID?></EWalletID> 5 <CardSerial><?php echo $CardSerial?></CardSerial> 6 <PinCard><?php echo $PinCard?></PinCard> 7 </TopupService> 8 </soap:Body> 9 </soap:Envelope> 1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pay="http://schemas.datacontract.org/2004/07/Payment.Utility.Object.RequestObject"> 2 <soapenv:Header/> 3 <soapenv:Body> 4 <tem:TopUp> 5 <!--Optional:--> 6 <tem:request> 7 <!--Optional:--> 8 <pay:CardSerial><?php echo $CardSerial?></pay:CardSerial> 9 <!--Optional:--> 10 <pay:EWalletID><?php echo $EWalletID?></pay:EWalletID> 11 <!--Optional:--> 12 <pay:PinCard><?php echo $PinCard?></pay:PinCard> 13 </tem:request> 14 </tem:TopUp> 15 </soapenv:Body> 16 </soapenv:Envelope>
Note: See TracChangeset
for help on using the changeset viewer.