Running multiple services

Discussion in 'ASP.NET WebServices' started by wrath, Mar 21, 2009.

  1. Is it possible to run more than one service in a particular web app folder or do I need to set up a different web app folder for it?

    I am getting this error even tho I set up custom service host.

    My orginal service still works...

    This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
    Parameter name: item


    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
    Parameter name: item

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:

    [ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item] System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +11520590 System.Collections.Generic.SynchronizedCollection`1.Add(T item) +67 System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +49 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +129 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11659932 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479[ServiceActivationException: The service '/wwdev/ChangeScenario.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +11531006 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176 System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +23 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75[/FONT]
     
  2. The easiest way is to just set the base address in the web.config instead of using custom service hosts.

    Code:
     <system.serviceModel>
          <serviceHostingEnvironment>
              <baseAddressPrefixFilters>
                  <add prefix="http://domain.com"/>
              </baseAddressPrefixFilters>
          </serviceHostingEnvironment>
     </system.serviceModel>
    
     

Share This Page