Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 469)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 470)
@@ -17,7 +17,6 @@
 	
 	public function testmo() {
-		$url = 'http://10.58.38.162/violetservice/soanbai/mo';
-		//$url = 'http://10.58.38.162/services/viettel';
-		//$url = 'http://viettel.violet.vn/violetservice/soanbai/mo';
+		$url = 'http://10.58.38.162/violetservice/soanbai/mo?wsdl';
+
 		$aryParams = array(
 				'username' => 'sbg',
@@ -45,5 +44,7 @@
 		//$result = $client->call('MOReceiver', $aryParams ,$operator ,$operation);
 		
-		$err = $client->getError();
+		echo $client->responseData;
+		
+		/* $err = $client->getError();
 			
 		if ($err) {
@@ -55,5 +56,5 @@
 		echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
 		echo "<h2>Response</h2>";
-		echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";		
+		echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; */		
 	}
 	
@@ -102,6 +103,7 @@
 	public function topup () 
 	{
+		$url = $this->config->item('topup_service_url');
 		$operator = 'TopupService';
-		$operation = 'http://tempuri.org/ITopupService/TopUp';
+		$operation = 'http://soanbaigiang.smas.vn/ITopupService/TopUp';
 		
 		$username = 'sbg';
@@ -123,13 +125,26 @@
 		$err = $client->getError();
 			
-		if ($err) {
-			echo '<p><b>Error: ' . $err . '</b></p>';
+		if ($client->fault) {
+		    echo "<h2>Fault loi:</h2><pre>";
+		    print_r($result);
+		    echo "</pre>";
 		}
-		
+		else {
+		    $error = $client->getError();
+		    if ($error) {
+		        echo "<h2>Error</h2><pre>" . $error . "</pre>";
+		    }
+		    else {
+		        echo "<h2>Ket Qua</h2><pre>";
+		        var_dump($result);
+		        echo "</pre>";
+		    }
+		}
 		echo "<br/>";
 		echo "<h2>Request</h2>";
 		echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
 		echo "<h2>Response</h2>";
-		echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";		
+		echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
+				
 	}
 	
Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 469)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 470)
@@ -9,10 +9,11 @@
 class Viettel extends MX_Controller 
 {
-	
 	function __construct() {
 		parent::__construct ();
+		
 		$this->nusoap_server = new soap_server ();
-		$this->nusoap_server->configureWSDL('messageReceiver', 'urn:messageReceiver');
-		$this->nusoap_server->soap_defencoding = 'UTF-8';
+		$this->nusoap_server->configureWSDL('messageReceiverWSDL','urn:messageReceiverWSDL');
+
+		$this->nusoap_server->soap_defencoding = 'UTF-8';		
 		$this->nusoap_server->methodreturnisliteral=TRUE;
 		
@@ -48,26 +49,20 @@
 						'info' => 'xsd:string',
 						'receiveTime' => 'xsd:string')
-				, array ('return' => 'xsd:string'),false,false
-				,'rpc'				
-				);
+				, array ('return' => 'xsd:string'),
+				'urn:messageReceiverWSDL',"urn:messageReceiverWSDL#MOReceiver","rpc","encoded");
 	}
 
-	function index() {
-		if($this->uri->segment(3) == "wsdl") {
+	public function index () 
+	{
+		if($this->uri->segment(4) == "wsdl") {
 			$_SERVER['QUERY_STRING'] = "wsdl";
 		} else {
 			$_SERVER['QUERY_STRING'] = "";
 		}
-		
-		function MOReceiver () {
-			return 'Service not available!';
-		}
-		
-		$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA:'';
-		$this->nusoap_server->service($HTTP_RAW_POST_DATA);
+		$this->nusoap_server->service(file_get_contents("php://input"));
 	}
 	
 	public function mo() 
-	{
+	{	
 		function MOReceiver($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $contentType ,$info, $receiveTime){
 			$msgType = '0'; //text message
@@ -95,9 +90,5 @@
 			
 			$result = $CI->userModel->register ($sentNumber, $receiverID, $serviceID, $commandCode, $info, $receiveTime, $status);
-			$aryAgrs = func_get_args ();
-			$fh = fopen('register.log', 'a+');
-			fwrite ($fh, var_export($aryAgrs, true). "\n");
-			fclose($fh);
-			
+					
 			$aryResult = explode ('|', $result);
 			
Index: /pro-violet-viettel/sourcecode/application/modules/services/views/topup.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/views/topup.php	(revision 469)
+++ /pro-violet-viettel/sourcecode/application/modules/services/views/topup.php	(revision 470)
@@ -1,9 +1,16 @@
-<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>
-    <TopupService xmlns="http://tempuri.org/">
-      <EWalletID><?php echo $EWalletID?></EWalletID>
-      <CardSerial><?php echo $CardSerial?></CardSerial>
-      <PinCard><?php echo $PinCard?></PinCard>
-    </TopupService>
-  </soap:Body>
-</soap:Envelope>
+<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">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <tem:TopUp>
+         <!--Optional:-->
+         <tem:request>
+            <!--Optional:-->
+            <pay:CardSerial><?php echo $CardSerial?></pay:CardSerial>
+            <!--Optional:-->
+            <pay:EWalletID><?php echo $EWalletID?></pay:EWalletID>
+            <!--Optional:-->
+            <pay:PinCard><?php echo $PinCard?></pay:PinCard>
+         </tem:request>
+      </tem:TopUp>
+   </soapenv:Body>
+</soapenv:Envelope>
