How to enforce creating of Service Metadata based on Host-Header?

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

When working with WCF in a bit more complex environment, you might run in following issue. Usually when you want to get metadata of the service you will navigate to service page and following appears:

image

The link shown in the picture above brings you to the WSDL description of the service. Unfortunately, this link will sometimes not work. For example the external service address is https://www.daenet.eu/service.svc and WSDL link https://internal.daenet.de/service,svc.
This issue will even more often happen, when you migrate the service in the cloud. In this case WSDL link point to some very strange address which is only internally visible at the Windows Azure machine.

After applying of the KB-update  (Win7+Server2008R2, Vista+Server2008) and setting up of following service behavior all will work fine:

<useRequestHeadersForMetadataAddress>
   <defaultPorts>
    
<add scheme="http" port="81" />
     
<add scheme="https" port="444" />
   
</defaultPorts>
</useRequestHeadersForMetadataAddress>

Here is the result. As you see all references to metadata are valid.

image

More information: http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues&referringTitle=Home


Posted Oct 06 2010, 11:46 PM by Damir Dobric
Filed under: , ,
developers.de is a .Net Community Blog powered by daenet GmbH.