Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Browse by Tags · View All
BRH 12
#DOTNET 10
#LINQ 6
LINQ 5
#ASP.NET 4
#DATAACCESS 4
ASP.NET 3
DOTNET 3
.NET 2
WCF 2

Archive · View All
July 2010 5
August 2010 4
June 2011 3
October 2010 1

How to replace Machine Name with Domain name in WCF Service wsdl link?

Jul 31 2010 10:41AM by IBhadelia   

I personally came across this issue WCF was taking machine name not IP address or domain name and also I got questions from forums about “how to replaced Machine Name with Domain name in WCF Service wsdl link?”. This occurs when we host WCF service on IIS then the links to wsdl is uses local machine name not the domain name or IP address.

image 

You can see in browser [here I used IP address of my machine] in wsdl link its adding my computer name, this is same issue when I publish this service on production; the wsdl link is taking name of production machine not domain.

I found some solutions which changes the bindings on server but again that is not helpful for me on production server however it works well on local machine.

Then I was checking the configurations and found solution for how Domain name replaced with Machine Name in WCF Service without playing with IIS bindings. In service behavior we can change the behavior of serviceMetadata which will FIX our problem. We need to specify on what location metadata will resides httpGetUrl or httpsGetUrl. We can add url having domain rather machine name. So final configuration should look like following which is our solution.

<system.serviceModel>
    <services>
      <service name="Demo.Service.MultiEndPointsService" behaviorConfiguration="serviceBehaviour">
        <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="basicBinding" 
                  contract="Demo.Service.MultiEndPointsService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehaviour">
          <serviceMetadata httpGetEnabled="true" 
                           httpGetUrl="http://192.168.3.61/Demo.Service/MultiEndPointsService.svc/basic"  />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="basicBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="None"></security>
          <readerQuotas maxStringContentLength="2147483647" />
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>

You can see value of httpGetUrl; I have specified IP address

image 

Now let’s see again in browser.

image 

There you goo!!!

Tags: #DOTNET, BRH, #WCF, DOTNET, WCF, #ASP.NET, ASP.NET,


IBhadelia
147 · 1% · 268
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising