我正在嘗試使用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客戶端的任何模式下成功使用它。
http://support.microsoft.com/kb/971493這有幫助嗎? – 2011-03-17 21:06:43
不,我需要傳入和傳出的消息都是安全的。 – Shagglez 2011-03-18 08:59:46
鑑於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