none
Base Address in WCF hosted in IIS RRS feed

  • Question

  • I have a WCF service that is being hosted in IIS 6.0.  When I browse to the svc I get the standard "You have created a Service" page.  There is a link there to the wsdl for the service.  The link to the wsdl has a base address of http://machinename.computerdomain/service.svc.  How and where is this changed.  I see that that same base address propogates through the wsdl and into the xsd files.  How do I associate an external domain name to the service correctly or an IP address?  I tried the following:

    Web.config
    Code Snippet

    <service ...>
        <host>
           <baseAddresses>

              <add baseAddress="http://localhost/" />

          </baseAddresses>

        </host>
     </service>


    I also placed full addresses in the endpoint configuration for the service and that did work for the portion of the wsdl for the SOA address in the wsdl, but the link to the wsdl and links to xsd are still machinename.computerdomain/

    I feel as though I am  missing something simple.  Any help is greatly appreciated.

    Carl
    Thursday, June 28, 2007 2:28 PM

Answers

All replies

  • The following MSDN documentations may be helpful in resolving your issue:
    http://msdn2.microsoft.com/EN-US/library/aa751792.aspx
    http://msdn2.microsoft.com/en-us/library/ms733766.aspx

    Let me know if that helps.

     

    Thursday, June 28, 2007 4:45 PM
  • I have read these posts multiple times and I feel I must be dense, because I don't see where they set the URL for the service besides what I have tried.
    Thursday, June 28, 2007 4:52 PM
  • I hope you can get some hints from this thread:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1095396&SiteID=1

    Thursday, June 28, 2007 6:02 PM
  • On my testing server, this worked great to be able to put the ip address in for the machine name and see the changes.  The problem I am having now is that we have a public IP mapped through ISA server to an internal IP for testing.  When hit externally with no host header, the machine name is placed in all links between the wsdl and xsd's.  If I add the host header with the public IP to the site, I get Invalid Hostname errors.  I am assuming this is an ISA issue now?  Any further ideas or resources?

    Thanks
    Thursday, June 28, 2007 8:43 PM
  • So I put in the external IP into the Host Header and the Web Publishing Rule in ISA seemed correct, but I still had issues.  Then I put a DNS entry in for the test server and changed the ISA rule to the name and the host header to the name and then everything worked fine.  Can anyone tell me why the IP didn't work, but the DNS entry resolving the same IP did?  MAkes no sense to me, but hey its working with all the right references now.  At least until I get HTTPS and put it on my other server!
    Friday, June 29, 2007 2:35 PM
  • I'm having the same issue, can you describe (or provide a link) the steps you went through to fix it?

     

    Thanks - Steve

    Wednesday, July 4, 2007 6:17 PM
  • Hi Carl,

     Can you help me to put ip address instead of the machine name in WCF service url? I would like to display the wsdl link as

    http://ipaddress/service1/service.svc?wsdl

     

    I tried keeping the static wsdl by saving the wsdl file. When i am adding service reference in client, it is giving some error to generate proxy class.

     

    All I want is to expose my WCF service through URL with ip address.

     

    Thanks

     

    Friday, August 17, 2007 9:42 PM
  • If you are not using https, just http, then the IP address needs to be enetered as the namespace and the Host Header value in IIS.  If you are using ISA server or HTTPs this gets a little more complicated.  I was never able to get only the IP to work with ISA, but it worked inside ISA just fine. 
    Friday, August 17, 2007 10:09 PM