2011-03-17 43 views
2

我正在尝试使用PHP安全的WCF服务,但我无法弄清楚语法。我认为这将是简单如下:如何使用PHP使用WCF安全服务?

$client = new SoapClient('https://localhost/service.svc?wsdl', array('userName' => "test", "password" => 'pass')); 

,而是它提出了在PHP异常An error occurred when verifying security for the message. ,和我从应用程序日志中MessageSecurityException: Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties. This can occur if the service is configured for security and the client is not using security.

这似乎引起此错误无论我尝试提供证书或不提供,所以我除非我得到的语法错误,这不是。

我已经看到了一些文章,也责备头,但我真的不知道如何指定一个,而不是提及它应该是什么。

值得一提的是,只要不安全,我可以成功使用服务。我也可以在.NET客户端的任何模式下成功使用它。

+0

http://support.microsoft.com/kb/971493这有帮助吗? – 2011-03-17 21:06:43

+0

不,我需要传入和传出的消息都是安全的。 – Shagglez 2011-03-18 08:59:46

+0

鉴于OP接受了一个只与另一个问题链接的答案,我假设这是一个可能的[如何使用一个使用自定义用户名验证和PHP页面的WCF Web服务?](http:// stackoverflow。 com/questions/6652227/how-to-consume-a-wcf-web-service-that-uses-custom-username-validation-with-a-php) – Jeroen 2013-12-23 08:25:41

回答