locked
IIS Baseaddress RRS feed

  • Question

  • Hi:

        I create two websites in IIS, one is using 192.168.1.2, one is using 192.168.1.3, host the same WCF service.

    In serviceFactory's CreateServiceHost(String, Uri[]), the Uri[] passed in seems using hostname not the ip address bind to the website.

    Is it an IIS behavior?

    Thanks

    Sunday, March 18, 2012 8:26 AM

Answers

All replies

  • Hi zhanghb0001

    IIS completly controls your base address.

    Read the section "IIS Addressing Considerations" in this article:

    Service Station: WCF Addressing In Depth
    http://msdn.microsoft.com/en-us/magazine/cc163412.aspx#S3

    Regards,

    JAXN


    MCTS: .NET Framework 4, Service Communication Applications

    • Marked as answer by zhanghb0001 Sunday, March 18, 2012 6:27 PM
    Sunday, March 18, 2012 8:55 AM
  • Hi Rupex

    As I understood zhanghb's question this is not about having multiple bindings for the same site. It is just that he wonders why IIS provides the host name to his factory - even though it access the sites through 2 diffrent IP addresses - in this case the host name will be the same no matter the address. He can of cause set a unique host name on the binding in IIS and then IIS will pass these and he will know in the factory code which site it came in from. But it is controlled through IIS.

    I might have misunderstood the question.

    zhanghb was this your question? - or is your issue with multiple bindings on one site?

    Regards,

    JAXN


    MCTS: .NET Framework 4, Service Communication Applications

    Sunday, March 18, 2012 1:13 PM
  • HI JAXN,

        You are right, it is about the hotname and IP.

    Thanks very much for you answer, also thanks Rupex for your reply and info.

    Sunday, March 18, 2012 6:25 PM
  • Yes, as JAXN has explained, when hosting WCF in IIS server, if we want to control the host information(like host name in base address) of the service, we should go through the IIS website's bindings configuration instead of the web.config or custom serviceHostFactory way like custom/self hosting scenario.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Putting communities in your palms. Launch the browser on your phone now, type aka.ms/msforums and get connected!

    Wednesday, March 21, 2012 3:27 AM