Calling a WCF WebService in PHP via wsHttpBinding

2019-05-09 07:30发布

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.)

2条回答
等我变得足够好
2楼-- · 2019-05-09 07:34

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

查看更多
Deceive 欺骗
3楼-- · 2019-05-09 07:50

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.

查看更多
登录 后发表回答