doujugu1722
2014-08-20 20:29
浏览 101
已采纳

PHP - SoapClient :: SoapClient无法打开流:连接被拒绝

I'm trying to integrate a PHP portal with a CRM(microsoft dynamics .NET) system using SOAP.

This is part of my code:

$client = new SoapClient("http://XX.XXX.X.XX:5050/host.svc?wsdl");

This line returns 2 errors

Warninig: Message: SoapClient::SoapClient(http://80.248.5.35:5050/host.svc?wsdl): failed to open stream: Connection refused

 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load   from 'http://XX.XXX.X.XX:5050/host.svc?wsdl' : failed to load external entity 

Opening the link in the browser works and running this code in my local machine(localhost) works also. i've tried file_get_contents("http://XX.XXX.X.XX:5050/host.svc?wsdl"); but this returns a warning message

Message: file_get_contents(http://80.248.5.35:5050/host.svc?wsdl): failed to open stream: Connection refused

i've tried so many solutions from stackoverflow. If anyone could help me with this or shed more light on the situation cause this is my first attempt at something like this. Thanks

图片转代码服务由CSDN问答提供 功能建议

我正在尝试使用SOAP将PHP门户与CRM(微软动态.NET)系统集成。

这是我的代码的一部分:

  $ client = new SoapClient(“http://XX.XXX.X.XX:5050  /host.svc?wsdl");
nn

此行返回2个错误

  Warninig:消息:SoapClient  :: SoapClient(http://80.248.5.35:5050/host.svc?wsdl):无法打开流:连接被拒绝
 
致命错误:未捕获的SoapFault异常:[WSDL] SOAP-ERROR:解析WSDL:无法 从'http://XX.XXX.X.XX:5050 / host.svc?wsdl'加载:无法加载外部实体
   
 
 

打开 浏览器中的链接工作并在我的本地计算机(localhost)中运行此代码也可以。 i已经尝试 file_get_contents(“http://XX.XXX.X.XX:5050 / host.svc?wsdl”); 但这会返回一条警告消息 \ n

 消息:file_get_contents(http://80.248.5.35:5050/host.svc?wsdl):无法打开流:连接被拒绝
   
 
  
 
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doueta6642 2014-09-03 17:12
    已采纳

    I found out the problem.

    My webserver was denying me from making outgoing connection through any port rather than the default port. i fixed it by changing the web service to the default pot on the ISS

    打赏 评论

相关推荐 更多相似问题