我正在创建网络服务。所以我创建了这个soapcall:
public function GetLogon($uzivatel, $heslo){
$soap = new SoapClient('http://www.softhouse.cz/ezopconnector2/ezopconnector.asmx?wsdl');
$params = array('uzivatel'=>$uzivatel, 'password'=>$heslo);
$response = $soap->__soapCall("EzopLogon", array($params));
var_dump($response);
}
在这样的演示者中称呼它,但我认为这不相关:
$this->me->GetLogon("administrator", "a");
我的问题是这个函数应该给我一个会话(用户)..有谁知道我怎么能得到这个会话以供将来使用? (例如注销)
非常感谢我是一个新手,所以不要对我说:D
更新
登录代码:
public function GetLogon($uzivatel, $heslo){
$soapClient = new SoapClient('http://www.softhouse.cz/ezopconnector2/ezopconnector.asmx?wsdl');
$params = array('uzivatel'=>$uzivatel, 'heslo'=>$heslo);
$this->session = $soapClient->__soapCall("EzopLogon", array($params));
var_dump($this->session);
}
会话在课程中保存为公共变量:
public $session;
需要会话si的功能代码:
public function GetCtiSezSdruzAdd2(){
$soapClient = new SoapClient('http://www.softhouse.cz/ezopconnector2/ezopconnector.asmx?wsdl');
$params = array('Session'=>$this->session);
return $soapClient->__soapCall("EzopCtiSeznamSdruzenychAdresaru", array($params));
}
并在演示者中致电:
$this->me->GetCtiSezSdruzAdd2();