开发者

Access WCF Service by Host Name and IP

开发者 https://www.devze.com 2023-01-23 05:07 出处:网络
I have a WCF service that is load balanced on multiple boxes.We have setup host headers in IIS for the service website so that the host name, not the machine name, will show up in the WSDL (like this:

I have a WCF service that is load balanced on multiple boxes. We have setup host headers in IIS for the service website so that the host name, not the machine name, will show up in the WSDL (like this: http://forums.asp.net/p/1096811/1659596.aspx).

Now we have a requirement that an internal process needs to be able to hit a page on each server independently by IP. What is th开发者_如何学JAVAe best way to setup a WCF service in IIS so that the host name shows up in the WSDL, but you are still able to hit the website by an internal IP without getting an "Bad Request (Invalid Hostname)" error?

I do know that it is possible to publish a custom WSDL, which would technically solve this requirement, but I would really rather not have to mess with manually updating a WSDL with every change.

Thanks in advance.


Easiest is to use the same WSDL as normal, but to update the generated client-side configuration (the address specified in the endpoint pointing to the service).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号