【问题标题】:acessing soap web service from another pc on the network从网络上的另一台电脑访问肥皂网络服务
【发布时间】:2017-03-22 19:28:56
【问题描述】:

这是我的肥皂网络服务网址: 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>`

【问题讨论】:

    标签: c# soap


    【解决方案1】:

    【讨论】:

    【解决方案2】:

    所以问题出在 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

    【讨论】:

      猜你喜欢
      • 2010-12-16
      • 1970-01-01
      • 1970-01-01
      • 2021-07-29
      • 2017-01-16
      • 2017-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多