c# - 托管提供商阻止 Web 服务响应 -(1and1 托管)

标签 c# asp.net asp.net-mvc-4 webservice-client

我有一个用 ASP.NET MVC 4 编写的应用程序。我可以访问远程 Web 服务。我将其作为 WebReference 添加到我的解决方案中。当我在本地主机上调用它的方法时,一切都很好,问题出在部署的版本上。服务器提供商将其运行为“中等信任”。当我从托管应用程序调用 WebService 方法时,出现错误:

enter image description here

我认为问题出在托管服务器上的防火墙规则中,我的服务绑定(bind)类型是“basicHttpBinding”,默认设置。在这种情况下,我的监听端口是随机的,那么我该如何通过它呢?如何为 WebService 响应设置静态监听端口,以便我可以要求托管提供商为我的应用程序设置防火墙端口?

我的绑定(bind)配置:

    <client>
      <endpoint address="http://WebServiceURL:8585/Api" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IETRService" contract="ETRService.IETRService" name="BasicHttpBinding_IETRService"  />
    </client>

最佳答案

部署时,您应该监听标准端口,我假设(从本地测试中删除端口:8585)以便连接到您的服务器。

<client>
    <endpoint address="http://WebServiceURL/Api" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IETRService" contract="ETRService.IETRService" name="BasicHttpBinding_IETRService"  />
</client>

关于c# - 托管提供商阻止 Web 服务响应 -(1and1 托管),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16107865/

相关文章:

c# - WinRT 中的数据触发器

c# - 允许一次只调用一个实例的异步方法

c# - C# 中的日期时间分析器错误

asp.net - 如何仅匹配无扩展名的 URL?

c# - 使用 jquery 设置一个值,在提交数据时删除对 ViewModel 的绑定(bind)

c# - 在 MVC Controller 中将 Javascript 时间字符串转换为 DateTime 或 TimeSpan

c# - 如何创建 Web 浏览器控件可以使用的本地服务器

c# - 使用其他XPath查询过滤XmlNodeList?

asp.net - 考虑到 header 名称,如何将HttpRequestBase转换为HttpRequestMessage?

asp.net-mvc - 将 powershell 脚本添加到 mvc 站点的 Web 部署包