我有这个类发送SOAP请求(该类还定义了头)
class Personinfo
{
function __construct() {
$this->soap = new SoapClient('mysource.wsdl',array('trace' => 1));
}
private function build_auth_header() {
$auth->BrukerID = 'userid';
$auth->Passord = 'pass';
$auth->SluttBruker = 'name';
$auth->Versjon = 'v1-1-0';
$authvalues = new SoapVar($auth, SOAP_ENC_OBJECT);
$header = new SoapHeader('http://www.example.com', "BrukerAutorisasjon", // Rename this to the tag you need
$authvalues, false);
$this->soap->__setSoapHeaders(array($header));
}
public function hentPersoninfo($params){
$this->build_auth_header();
$res = $this->soap->hentPersoninfo($params);
return $res;
}
}
Run Code Online (Sandbox Code Playgroud)
问题是我的功能有问题而且响应是错误的.我想知道我的请求发送了什么内容,但我无法弄清楚如何.
我在hentPersoninfo函数中尝试了一个try/catch-block,它调用$this->soap->__getLastRequest但总是为空.
我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
421 次 |
| 最近记录: |