Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 防火墙后面的WCF服务生成错误的wsdl URI_C#_Wcf_Firewall - Fatal编程技术网

C# 防火墙后面的WCF服务生成错误的wsdl URI

C# 防火墙后面的WCF服务生成错误的wsdl URI,c#,wcf,firewall,C#,Wcf,Firewall,我开发了一个WCF服务,并用IIS发布了它。在本地网络中一切都进行得很顺利,但当外部客户端从internet访问服务时,该服务会被防火墙重定向,该服务会生成一个本地wsdl uri,而客户端无法解决该uri 大概是这样的: 需要的URI:http://外部url/service.svc?wsdl 创建的URI:http://内部url/service.svc?wsdl 我希望继续使用wsdl文件的自动生成,而不指示外部路径。我还证明了如何将ServiceBehavior属性操纵到服务类中,但

我开发了一个WCF服务,并用IIS发布了它。在本地网络中一切都进行得很顺利,但当外部客户端从internet访问服务时,该服务会被防火墙重定向,该服务会生成一个本地wsdl uri,而客户端无法解决该uri

大概是这样的:

  • 需要的URI:http://外部url/service.svc?wsdl
  • 创建的URI:http://内部url/service.svc?wsdl
我希望继续使用wsdl文件的自动生成,而不指示外部路径。我还证明了如何将ServiceBehavior属性操纵到服务类中,但问题仍然存在


如何操作?

您需要在IIS中为您的网站配置serverBinding标头。
以下是一个步骤,链接文档为我提供了404,但archive.org提供了404。在IIS7中,它更简单:在IIS管理器中,将绑定的“主机名”设置为系统的外部名称。对于自托管服务,如何?