从网络上的另一台电脑获取肥皂网服务

时间:2017-03-22 19:28:57

标签: c# soap

所以这是我的soap webservice url: http://localhost:50691/WebService.asmx 它工作正常。 但我想通过我的IP地址访问它,如下所示: http://192.168.1.2:50691/WebService.asmx 但不幸的是我没有回应。 我正在使用c#来创建web服务,那么有什么办法可以使web服务可用吗?

修改
我认为解决方案是向WSDL添加另一个包含我的IP(192.168.1.2)的端点,但问题是,如何?

    `<wsdl:service name="WebService">
     <wsdl:port name="WebServiceSoap" binding="tns:WebServiceSoap">
     <soap:address location="http://localhost:50691/WebService.asmx"/>
     </wsdl:port>
     <wsdl:port name="WebServiceSoap12" binding="tns:WebServiceSoap12">
     <soap12:address location="http://localhost:50691/WebService.asmx"/>
     </wsdl:port>
     </wsdl:service>`

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

问题出在IIS上,你需要让它接受来自localhost以外的任何类型的ip地址的请求
这是解决方案

  1. 请确保您的防火墙没有阻止IIS,在我的情况下:我只是暂时禁用了avg
  2. 以管理员身份运行visual studio
  3. 在`$(solutionDir)\。vs \ config \ applicationhost.config`中我不得不将绑定从bindingInformation =“*:50691:localhost”更改为bindingInformation =“:50691:”
  4. 运行应用程序并从其他设备打开http://192.168.1.2:50691/WebService.asmx
相关问题