Sending login and password through PHP Soap Client doesn't get picked up by WCF Service Host?

StackOverflow https://stackoverflow.com/questions/6125649

Question

I am instantiating a PHP Soap Client like this:

$client = new SoapClient('http://localhost:8731/MathService?wsdl',array(
'login' => "test2", 'password' => "test"));

When I do this above, the Request contains:

Authorization: Basic dGVzdDI6dGVzdA==

But the above is not being picked up by my CustomUserNamePasswordValidator. I just have the WCF Service running in a Console app, so I do not know how to set the client credentials on the service host. I am using TransportWithCredentialOnly with Basic HTTP and Message="UserName". My CustomUserNamePassword Validator is hard-coded only to accept test and test as the username and password, but even if I pass in test2 to the SoapClient, the operation still passes.

Était-ce utile?

La solution

I changed the Security mode to TransportCredentialOnly and the transport clientCredentialType to Basic and it worked.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top