简体   繁体   English

无法使用soapclient从php访问iis上托管的wcf服务

[英]Cannot access wcf service hosted on iis from php with soapclient

This has been really painful for the last few hours and I just have no more ideas what to do. 在过去的几个小时中,这确实让我很痛苦,我只是不知道该怎么办。

Tried many solutions that I found on here without any luck... 尝试了许多我在这里找不到的解决方案...

I have an iis server that is hosting a wcf web service. 我有一个托管WCF Web服务的IIS服务器。 Simple stuff. 简单的东西。

I can connect to this (example: http://mydomain.com/Service.svc?wsdl ) from the iis server and all other computers without any problems. 我可以从iis服务器和所有其他计算机连接到此服务器(例如: http : //mydomain.com/Service.svc?wsdl ),而不会出现任何问题。

So I went on to make a php client on my computer - (using xampp via localhost) - (not on the iis server) 所以我继续在我的计算机上制作一个php客户端-(通过localhost使用xampp)-(不在iis服务器上)

        $wcfClient = new SoapClient('http://mydomain.com/Service.svc?wsdl');
    $args = //input data
    $response = $wcfClient->GetData($args);
    print_r($response->GetDataResult->Post);

This works perfect. 这完美。 No problems at all. 完全没有问题。 It returns all the data... Then I went on to upload this to my hosting account. 它返回所有数据...然后,我继续将其上传到我的托管帐户。 This is the error I keep getting. 这是我不断得到的错误。

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ....

I have no more ideas. 我没有其他想法了。 Disabled firewall, changed web.config a million times and still no luck. 禁用防火墙,将web.config更改一百万次,但仍然没有运气。 I tried the file_get_contents method to see what's up. 我尝试使用file_get_contents方法查看最新情况。 I keep getting: 我不断得到:

failed to open stream: Connection refused

我只是通过将iis服务器上的端口更改为80来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM