通过调用一个的wsHttpBinding WCF web服务在PHPWCF、wsHttpBinding、PHP、web

2023-09-03 03:57:38 作者:与你心安

我有一个WCF web服务我可以通过basicHttp连接到它,但不wsHttp。我试着通过wshttp通过以下来conenct吧:

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

到SoapClient的构造函数的调用返回的罚款。当我尝试调用一个使用的客户端 - $>函数名,页面只是坐在那里装了好一阵子,最终返回错误错误获取HTTP标头。究竟是什么这个应该是说,如何解决呢? (消费从.Net客户端的作品完美的服务。)

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

推荐答案

在默认配置上的wsHttpBinding采用先进的WS-Security和未用香草PHP SoapClient的理解的WS-Addressing功能。有迹象表明,也许能工作(的Apache Axis2的+壁垒/ C,例如)其他PHP访问的SOAP客户端,或者你可以尝试关闭一些不兼容的wsHttpBinding功能(邮件安全性可能是第一个)。不是说这是行不通的,但你可能需要一些试验和错误,以得到这一切工作的权利。

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.