I have a WCF web service which allows both Basic HTTP and WS-HTTP clients, both over HTTPS using user name & password authentication. This is achieved with two bindings on the same service.
So, the service is at https://foo.com/Service.svc, the Basic HTTP (SOAP 1.1) endpoint is https://foo.com/Service.svc/Unp11, and the WS-HTTP (SOAP 1.2) endpoint is https://foo.com/Service.svc/Unp .
A client is trying to access this web service via PHP 5, using its built-in SOAP support, and is having trouble connecting to the service. He keeps getting an HTTP 400 (Bad Request) response, which tends to happen if the SOAP message is badly formed, or a SOAP 1.1 message is sent to a SOAP 1.2 endpoint (or vice versa).
I only know basic PHP so I'm having trouble helping him. I know you can create a client by doing
$client = new SoapClient('https://foo.com/Service.svc?wsdl');
but how do you specify the binding/endpoint? Are there any known issues achieving all this with PHP?
UPDATE
Ok, so I can use PHP to connect to the WCF service ok (specifying the SOAP version in the SoapClient
constructor), and calling $client->__getFunctions()
returns a correct list of all the web service operations.
When I try to call one using $client->__soapCall
, the page just sits there loading for quite a while, and eventually returns the error "Error Fetching http headers". What exactly is this supposed to mean and how do I fix it? (Consuming the service from .Net client works perfectly.)