Linking IIS to Receive Location

I built a new solution today that used the BizTalk deployment framework to deploy everything - including a WCF service into IIS.

I created the service by using the publishing wizard and choosing to "publish schema". After completing the Wizard a new Virtual Directory could be found in my inetpub\wwwroot folder, I also elected for it to create a receive location in my application.

The root of my virtual directory contains a generic .svc file with the following content:

<%@ ServiceHost Language="c#" Factory="Microsoft.BizTalk.Adapter.Wcf.Runtime.BasicHttpWebServiceHostFactory, Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

As you can see, nothing in there to link to the BizTalk receive location. There's also nothing to be found in the associated web.config. So, on receipt of a request to this web service, how does IIS know which receive location should deal with it?

I've followed this process dozens of times over the years and because "it just works" I've never really considered how. Today I thought I'd take a short break to find out! The answer can be found in a BindingInfo.xml file that gets created in a App_Data\Temp sub folder that gets created below the inetpub\wwwroot\ folder. In this file, I found the following content:

<ReceivePort Name="WcfReceivePort_BizTalkCorporate/MvcForms/MvcForms" IsTwoWay="true">
  <ReceiveLocations>
    <ReceiveLocation Name="WcfService_BizTalkCorporate/MvcForms/MvcForms">
      <Address>/BizTalkCorporate/MvcForms/MvcForms.svc</Address>