WCF Service Deployment Problem

Discussion in 'Silverlight' started by gmpat4u, Sep 2, 2010.

  1. Hi Friends,

    I have created one WCF Service Project. From development environment it works perfectly. WCF Service opens in Browser. I can add it's reference to client application. I can call functions of the services. Functions reply is intact as well.

    But when I publish it to my hosting server; it do not work. It generates error. I have windows hosting which supports .Net 1.0, 2.0, 3.0, 3.5, 4.0.

    Before it was giving me error in web.config file for setting of Authentication and Remote Error Mode; which I corrected already.

    Please help me out solving this problem. I'm fighting with this since 4 days and I'm bit new with WCF Services.

    This is my Web.Config file...

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Web.Config
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <system.serviceModel>
    <services>
    <service behaviorConfiguration="FinanceWatch.Service1Behavior"
    name="FinanceWatch.FinanceWatch">
    <endpoint address="" binding="wsHttpBinding" contract="FinanceWatch.IServiceFw">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
    </services>
    </system.serviceModel>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error After Correcting Web.Config Error
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Server Error in '/' Application.

    This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
    Parameter name: item
    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) +11589374
    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) +11729164
    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

    [ServiceActivationException: The service '/FinanceWatch/FinanceWatch.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) +11599786
    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


    Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
     
  2. Please help me out solving this problem. I'm fighting with this since 4 days and I'm bit new with WCF Services.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

Share This Page