WCF provides incorrect URL in WSDL behind the load balancer

I installed wcf on the web server cluster behind the load balancer.

The pubblic address is: http://externaldomain/mywcf.svc, It is the only endpoint that users should visit.

So, when I paste this url in the browser to view the “help page” (the page that shows me the URL of its “wsdl” file)
The address is not what I expected: “http://externaldomain/mywcf.svc?wsdl” but “http://server1/mywcf.svc?wsdl” (server1 is the name of the server running wcf, the user has been load balanced Router)

This makes it impossible to add services to visualstudio, because the suggested address “http://server1/mywcf.svc=wsdl” is a private URL

So, I should How to configure wcf settings so that “aspnet” generates help pages with “correct” addresses?
Is there some “proxy” node or something similar to the setting in web.config

#### public url #### #### private url ####

(http://server1)
----------------
--> - webserver1- -
/ ----------------
/
(http://externaldomain) /
------- --------------- /
--- load balancer ----
----------------- ----- \
\
\
\ (http://server2)
--> --------------- -
- webserver2 --
----------------

For cases like useRequestHeadersForMetadataAddress, WCF has special behavior.









This behavior makes the service replace the url with the url used in the request, so it avoids The problem you mentioned. More information: http://zamd.net/wcf/2010/01/14/using-request-headers-for-metadata-address.html

I installed wcf on the web server cluster behind the load balancer.

The pubblic address is: http://externaldomain/mywcf.svc, which is what users should visit The only endpoint.

So, when I paste this url in the browser to view the “help page” (it shows me the page with the URL of its “wsdl” file)
The address is not what I expected : “Http://externaldomain/mywcf.svc?wsdl” but “http://server1/mywcf.svc?wsdl” (server1 is the name of the server running wcf, and the user has been routed by the load balancer)

This makes it impossible to add the service to visualstudio because the suggested address “http://server1/mywcf.svc=wsdl” is a private URL

So, how should I configure the wcf settings to make “Aspnet” generates a help page from the “correct” address?
Is there some “proxy” node or something similar to the setting in web.config

#### public url #### #### private url ####

(http://server1)
----------------
--> - webserver1- -
/ ----------------
/
(http://externaldomain) /
------- --------------- /
--- load balancer ----
----------------- ----- \
\
\
\ (http://server2)
--> --------------- -
- webserver2 --
----------------

For things like In cases like useRequestHeadersForMetadataAddress, WCF has a special behavior.





< useRequestHeadersForMetadataAddress/>



This behavior makes the service replace the url with the url used in the request, so it avoids the problem you mentioned. More information: http://zamd.net/wcf/2010 /01/14/using-request-headers-for-metadata-address.html

Leave a Comment

Your email address will not be published.