views:

498

answers:

1

I'm trying something new to me using WCF and WWF to build up a set of services for use by a few client applications. I'm create 2 libraries (Workflows and Services) and 1 Web Application called API. The web application is hosted within IIS 7.

In the API web application, I've added a file called InventoryService.svc file that has Service set to my Workflow Service type (existing within the Workflows library) and Host is set to "System.ServiceModel.Activiation.WorkflowServiceHostFactory".

I'm pretty sure the config is correct but here it is:

<system.serviceModel>
 <behaviors>
  <serviceBehaviors>
    <behavior name="SynchronizeInventoryBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceCredentials>
        <windowsAuthentication
            allowAnonymousLogons="false"
            includeWindowsGroups="true" />
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
 </behaviors>
 <services>
  <service name="Workflows.SyncronizeInventory" 
           behaviorConfiguration="SynchronizeInventoryBehavior">
    <endpoint address=""
              binding="wsHttpContextBinding"
              contract="Services.IInventoryService">
    </endpoint>
    <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange">
    </endpoint>
  </service>
 </services>
</system.serviceModel>

Each attempt I make at starting the application and browsing to InventoryService.svc in my browers results in an exception with a message of:

The virtual path '/IS%20API/InventoryService.svc' maps to another application, which is not allowed.

I've never seen this sort of excepion before. Can anyone lend any insight? The stack trace is below. Thanks!

[ArgumentException: The virtual path '/IS%20API/InventoryService.svc' maps to another application, which is not allowed.]
   System.Web.VirtualPath.FailIfNotWithinAppRoot() +8945786
   System.Web.Compilation.BuildManager.ValidateVirtualPathInternal(VirtualPath virtualPath, Boolean allowCrossApp, Boolean codeFile) +229
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +106
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
   System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +27
   System.ServiceModel.Activation.WorkflowServiceHostFactory.GetTypeFromString(String typeString, Uri[] baseAddresses) +248
   System.ServiceModel.Activation.WorkflowServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +123
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +516
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/IS API/InventoryService.svc' cannot be activated due to an exception during compilation.  The exception message is: The virtual path '/IS%20API/InventoryService.svc' maps to another application, which is not allowed..]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11586762
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

.SVC File Content

<%@ ServiceHost Language="C#" Debug="true" Service="Workflows.SyncronizeInventory" Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory" %>

A: 

Please post your .svc file. I suspect that's where the path is wrong.

Is your web application rooted at '/IS API', and is it configured as an application in IIS? Is there an '/IS API/bin' folder with the assemblies from the workflow service?

John Saunders