Ignore:
Timestamp:
Nov 11, 2014 9:40:48 PM (11 years ago)
Author:
dungnv
Message:
 
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  
    1717       
    1818        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
    2221                $aryParams = array(
    2322                                'username' => 'sbg',
     
    4544                //$result = $client->call('MOReceiver', $aryParams ,$operator ,$operation);
    4645               
    47                 $err = $client->getError();
     46                echo $client->responseData;
     47               
     48                /* $err = $client->getError();
    4849                       
    4950                if ($err) {
     
    5556                echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
    5657                echo "<h2>Response</h2>";
    57                 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";             
     58                echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; */           
    5859        }
    5960       
     
    102103        public function topup ()
    103104        {
     105                $url = $this->config->item('topup_service_url');
    104106                $operator = 'TopupService';
    105                 $operation = 'http://tempuri.org/ITopupService/TopUp';
     107                $operation = 'http://soanbaigiang.smas.vn/ITopupService/TopUp';
    106108               
    107109                $username = 'sbg';
     
    123125                $err = $client->getError();
    124126                       
    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>";
    127131                }
    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                }
    129143                echo "<br/>";
    130144                echo "<h2>Request</h2>";
    131145                echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
    132146                echo "<h2>Response</h2>";
    133                 echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";             
     147                echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
     148                               
    134149        }
    135150       
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php

    r460 r470  
    99class Viettel extends MX_Controller
    1010{
    11        
    1211        function __construct() {
    1312                parent::__construct ();
     13               
    1414                $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';               
    1718                $this->nusoap_server->methodreturnisliteral=TRUE;
    1819               
     
    4849                                                'info' => 'xsd:string',
    4950                                                '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");
    5353        }
    5454
    55         function index() {
    56                 if($this->uri->segment(3) == "wsdl") {
     55        public function index ()
     56        {
     57                if($this->uri->segment(4) == "wsdl") {
    5758                        $_SERVER['QUERY_STRING'] = "wsdl";
    5859                } else {
    5960                        $_SERVER['QUERY_STRING'] = "";
    6061                }
    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"));
    6863        }
    6964       
    7065        public function mo()
    71         {
     66        {       
    7267                function MOReceiver($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $contentType ,$info, $receiveTime){
    7368                        $msgType = '0'; //text message
     
    9590                       
    9691                        $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                                       
    10293                        $aryResult = explode ('|', $result);
    10394                       
  • 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.