[英]PHP SOAP HEADER Construction (wsse)
I need to write the SOAP Header inside PHP as is described in the picture below: 我需要在PHP中编写SOAP Header,如下图所示:
My first attempt was an array which I would pass to the SoapClient method __setSoapHeaders()
: 我的第一次尝试是将数组传递给SoapClient方法
__setSoapHeaders()
:
array(
new SoapHeader($namespace, 'UsernameToken', $this->partner->partner_id),
new SoapHeader($namespace, 'USERNAME', $this->partner->email),
new SoapHeader($namespace, 'PASSWORD', $this->partner->password)
);
The error I keep getting when making the actual __soapCall()
is: 在进行实际的
__soapCall()
时,我不断遇到的错误是:
Fatal error: SOAP Fault: (faultcode: ns1:InvalidSecurity, faultstring: An error was discovered processing the header.)
I just seem unable to get it to work. 我似乎无法使用它。 Any help with this would be greatly appreciated.
任何帮助,将不胜感激。
使用WsSecurity项目,它将在几秒钟内完成,因为您可以轻松地将SoapHeader添加到现有请求中,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.