防火墙后面的WCF服务生成错误的wsdl URI [英] A WCF service behind a firewall generates a wrong wsdl URI

查看:125
本文介绍了防火墙后面的WCF服务生成错误的wsdl URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了WCF服务,并且已经通过IIS发布了它.一切都在本地网络中顺利进行,但是当外部客户端从Internet访问该服务并通过防火墙重定向时,该服务将生成客户端无法解决的本地wsdl uri.

I developed a WCF service and i have published it with IIS. All goes well inside the local network but when the service is accessed by an external client from the internet, redirected by a firewall, the service generates a local wsdl uri that cannot be solve by the client.

类似这样的东西:

  • 需要URI :http:// external_url /service.svc?wsdl
  • 创建的URI :http:// internal_url /service.svc?wsdl
  • URI needed: http://external_url/service.svc?wsdl
  • URI created: http://internal_url/service.svc?wsdl

我想继续使用wsdl文件的自动生成,而不指示外部路径.我还证明了将 ServiceBehavior 属性处理到服务类中,但是问题仍然存在.

I would like to continue using the automatic generation of the wsdl file without indicating an external path. I also have prove manipulating the ServiceBehavior attribute into the service class but the problem persists.

我该怎么办?

推荐答案

您需要在IIS中为您的网站配置serverBinding标头. 这是

You need to configure the serverBinding header for your website within IIS. Here is a step by step for configuring WCF WSDL to use external domain name

这篇关于防火墙后面的WCF服务生成错误的wsdl URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆