Advertisement
joris

Yii NuSoap

Feb 25th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. public function actionSoapclient()
  2. {      
  3.     if(isset($_POST['dn']))
  4.     {
  5.         $NoPel = $_POST['dn'];
  6.         if (preg_match ("/^([0-9]+)$/", $DN)) {
  7.             $NuSOAPLibPath = Yii::getPathOfAlias('ext.nusoap');
  8.             include($NuSOAPLibPath . DIRECTORY_SEPARATOR . 'nusoap.php');
  9.            
  10.             $client = new nusoap_client('http://www.domain.com/proses.php');
  11.            
  12.             //Baris setCredentials dipake kalo butuh autentikasi
  13.             $client->setCredentials("remotedata","@@@@@dont_try_this@@@@@","basic");
  14.            
  15.             $BacaSOAP = $client->call('inquiry', array('DN' => $NoPel, 'CODE' => '007'));
  16.            
  17.             echo CJSON::encode($BacaSOAP);    
  18.         }else{
  19.             Yii::app()->end();
  20.         }
  21.     }else{
  22.         Yii::app()->end();    
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement