2

I am trying to consume a secure WCF service with PHP, and I can't figure out the syntax. I thought it would be as simple as following:

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

but instead it raises an exception An error occurred when verifying security for the message. in PHP, and I get the following from Application Log 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.

It seems to raise this error regardless of whether I try to supply credentials or not, so I unless I'm getting the syntax wrong, it's not that.

I've seen a few posts around that also blame the header, but I can't really figure out how to specify one, not to mention what it should be.

It's worth mentioning that I can consume the service successfully, as long as it's unsecured. I can also consume it successfully in any mode with a .NET client.

Shagglez
  • 1,522
  • 3
  • 21
  • 38
  • http://support.microsoft.com/kb/971493 Does this help? – Joe Phillips Mar 17 '11 at 21:06
  • No, I need both incoming and outgoing messages to be secure. – Shagglez Mar 18 '11 at 08:59
  • Given that OP accepted an answer that only links to another question I'd assume that this is a possible duplicate of [How to consume a WCF Web Service that uses custom username validation with a PHP page?](http://stackoverflow.com/questions/6652227/how-to-consume-a-wcf-web-service-that-uses-custom-username-validation-with-a-php) – Jeroen Dec 23 '13 at 08:25

0 Answers0