locked
ASP.NET 2.0 add WCF reference RRS feed

  • Question

  • User2043281626 posted

    Hello,

    I am adding a .NET 4.5 WCF as a web reference to a .NET 2.0 assembly. The WCF is https and uses a DNS; so that when we migrate to different servers we won't have to worry about changing that portion. However, when I type in https://Some_DNS_Name/MyWcf.svc the "Some_DNS_Name" gets converted to the server name in the config file, which we absolutely do not want. How can I get it to continue using the DNS?

    Wednesday, October 2, 2013 12:31 PM

Answers

All replies

  • User220959680 posted

    web reference to a .NET 2.0 assembly

    Refer http://msdn.microsoft.com/en-us/library/bb628649.aspx

    *Note that the service was created using v4.5, it is mandatory to add Service reference rather than Web Reference

    Legacy XML that are also called as ASMX service refernces added using Web Reference feature in visual studio.

    Wednesday, October 2, 2013 9:40 PM
  • User-742633084 posted

    Hi noobville,

    I think the problem you encounter is probably due to the WCF service hosted in IIS server by default expose its private/local server name in the auto-generated WSDL metadata document. therefore, your generated service/web reference at client-side will pointing to the private/local server address (based on the value in wsdl document).

    If this is the case, to resolve the problem, we need to perform some configuration at the IIS server side. We need to configure the HTTP binding setting of the web site (in IIS) which host the WCF service and specify the public DNS address as its HTTP binding's address:

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 3, 2013 11:51 PM