Skip to content

Instantly share code, notes, and snippets.

@virbo
Created May 19, 2016 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virbo/cd63dce883c6ad0a9e256d85fd60c35c to your computer and use it in GitHub Desktop.
Save virbo/cd63dce883c6ad0a9e256d85fd60c35c to your computer and use it in GitHub Desktop.
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use Esyst\Nusoap\NusoapClient;
/**
* Soap Module
*
* @author Yusuf Ayuba
* @copyright 2016
* @link http://dutainformasi.net
*/
class Soapmodel extends Model
{
protected $wsdl;
public function __construct()
{
parent::__construct();
$this->wsdl = new NusoapClient("http://localhost:8082/ws/live.php?wsdl", true);
}
public function token($username,$password)
{
return $this->wsdl->call('GetToken',[
'username' => $username,
'password' => $password
]);
}
public function listtable($token)
{
return $this->wsdl->call('ListTable',[
'token' => $token
]);
}
public function dictionary($token,$tabel)
{
return $this->wsdl->call('GetDictionary', [
'token' => $token,
'table' => $tabel
]);
}
public function recordset($token, $table, $filter, $order, $limit, $offset) {
return $this->wsdl->call('GetRecordset',[
'token' => $token,
'table' => $table,
'filter' => $filter,
'order' => $order,
'limit' => $limit,
'offset' => $offset
]);
}
public function record($token, $table, $filter) {
return $this->wsdl->call('GetRecord', [
'token' => $token,
'table' => $table,
'filter' => $filter
]);
}
}
//location app\models\Soapmodel.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment