【发布时间】:2021-01-11 08:29:07
【问题描述】:
我有一个使用 GET 函数运行的简单 WCF 服务。 当我在网络浏览器中调用它时。它工作正常。
当我尝试以下 PHP 调用时:
define('NEWLINE' , "< br />\n");
$wsdl = "https://www.***.info/Webservices/WCF/***.svc?wsdl";
Line 727: $soapClient= new SoapClient($wsdl,array('cache_wsdl' => 0));
$result = $soapClient->TestForPHP();
$soapClient = null;
echo "WCF service Return value: "." "."($result->getMessageResult)". NEWLINE;
我在调试中收到以下错误:
PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. in /home/customer/www/staging9.***.com/public_html/wp-content/themes/hello-theme-child-master/functions.php:727
这是我的绑定在我的 web.config 文件中的样子:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="inculdeExceptionDetails">
<serviceDebug includeExceptionDetailInFaults="true " />
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior>
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="https">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" scheme="http" />
<add binding="webHttpBinding" scheme="https" bindingConfiguration="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
这个 web 服务正在被其他 .NET 客户端成功使用,但这是我第一次尝试使用 PHP。 我也刚刚测试过,它可以在 jquery 中工作(现在我将使用它)。 老实说,我不了解我的绑定设置,尽管我记得我确实很难将其设置为适用于我的 .NET 客户端
【问题讨论】:
-
不确定stackoverflow.com/questions/9157837/…是否是同一个问题。
标签: php web-services wcf soap