我有这个类来发送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;
}
}
的问题是,有什么错我的功能和该响应是一个错误。我想知道我的请求中包含哪些内容,但我无法弄清楚。
我试过try/catch-block在hentPersoninfo函数中调用$this->soap->__getLastRequest
,但它总是空的。
我在做什么错?
什么是错误?错误来自哪里?如果它来自您发送的服务器,则解析错误响应。如果你想知道你要发送什么,请尝试wireshark – KevinDTimm 2012-02-10 12:51:51