.NET WCF service references use server name rather than IP address causing issues when consuming

后端 未结 3 861
谎友^
谎友^ 2021-01-19 10:57

So, I\'m a newbie to WCF...

I created my ServiceLibrary and web-site project that consumed the ServiceLibrary. I am able to access the service by creating a proxy cl

相关标签:
3条回答
  • 2021-01-19 11:29

    Take a look at the WCFExtras library. In particular, the section on "Override SOAP Address Location URL". The brief answer is that you need a custom endpoint behavior provided by implementing IWsdlExportExtension.ExportEndpoint.

    0 讨论(0)
  • 2021-01-19 11:37

    I think I may have found a solution, which was to change the IIS site binding to be that of the IP address. I still don't understand why this can't be a setting in the .config file.

    Here is the link to the solution that I found (http://blogs.msdn.com/wenlong/archive/2007/08/02/how-to-change-hostname-in-wsdl-of-an-iis-hosted-service.aspx).

    Here is a link to my post about finding the solution (WCF (hosting service in IIS) - machine name automattically being picked up by WCF rather than IP?).

    0 讨论(0)
  • 2021-01-19 11:40

    Put

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    

    befor closing the system.serviceModel tag. It should end like this:

    <system.serviceModel > 
           .
           .
           .
       <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    </system.serviceModel >
    
    0 讨论(0)
提交回复
热议问题