简体   繁体   English

PHP SOAP HEADER构造(wsse)

[英]PHP SOAP HEADER Construction (wsse)

I need to write the SOAP Header inside PHP as is described in the picture below: 我需要在PHP中编写SOAP Header,如下图所示:

SOAP Request Example SOAP请求示例

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM