views:

402

answers:

2

I have a WCF webservice I can connect to it via basicHttp, but not wsHttp. I try to conenct to it via wshttp via the following:

$service = new SoapClient
("http://service.companyname.local:6666/Service/?wsdl",
 array(
         "location" => "http://service.companyname.local:6666/Service/WCF",

 "trace" => true,
 'soap_version' => SOAP_1_2
     )
);

The call to the SoapClient constructor returns fine. When I try to call one using $client->FunctionName, 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.)

A: 

The last time I checked, php didn't support wsHttpBinding

Svetlozar Angelov
Svetlozar, Where did you check? Did you write some code, look on google and get as far as I did? Did you check in the PHP documentation? some mailing list? If it can't be done, I want to know why it can't be done.
Justin Dearing
+1  A: 

The default config on wsHttpBinding uses advanced WS-Security and WS-Addressing features that aren't understood by the vanilla PHP SoapClient. There are other PHP-accessible SOAP clients that might be able to work (Apache Axis2+Rampart/C, for instance), or you can try to shut off some of the incompatible wsHttpBinding features (message security is probably the first). Not to say that it won't work, but you'll probably need some trial-and-error to get it all working right.

nitzmahone