http://server/web/Service.svc?wsdlTypically, the generated WSDL is not complete. The types are loaded separately from the server:
<xsd:import schemaLocation="http://server/web/Service.svc?xsd=xsd0" />For the type import, the current machine is used. Normally this isn't a problem. But if you use a load balancer, you end up with the following requests:
http://loadbalancer/web/Service.svc?wsdl <xsd:import schemaLocation="http://node1/web/Service.svc?xsd=xsd0" />This will not work, when node1 is not accessible directly.
Fortunately, you can force WCF to use the Loadbalancer also in the WSDL. You only have to add one line to the serviceBehavior in the Web.config:
<behaviors> <serviceBehaviors> <behavior name="MyBehavior"> <useRequestHeadersForMetadataAddress /> ... </behavior> </serviceBehaviors> </behaviors>