Hosting provider blocks webservice response - (1and1 hosting)

▼魔方 西西 提交于 2021-02-08 06:19:14

问题


I have an application written in ASP.NET MVC 4. I got access to remote web service. I added it to my solution as WebReference. When i call it's methods on my localhost all works great, the problem is on deployed version. Server provider run it as "Medium Trust". When i call WebService methods from hosted application i got an error:

enter image description here

I think the problem is in firewall rules on hosting server, my binding type for the service is "basicHttpBinding" with defaults settings. In this case my listening port is random, so how i can get through it? How to set static listening port for WebService response, so i can ask hosing provider to set firewall port open for my application?

My binding config:

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

回答1:


When you deploy, you should be listening on a standard port, I would assume (remove the port :8585) from your local testing in order to connect to your server.

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


来源:https://stackoverflow.com/questions/16107865/hosting-provider-blocks-webservice-response-1and1-hosting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!