问题
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.
Something like this:
- URI needed: http://external_url/service.svc?wsdl
- URI created: http://internal_url/service.svc?wsdl
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.
How can I do it?
回答1:
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
来源:https://stackoverflow.com/questions/574768/a-wcf-service-behind-a-firewall-generates-a-wrong-wsdl-uri