locked
Deploying ADO.NET Data Service for SIlverlight RRS feed

  • Question

  • Hello,

    I have a Silverlight application running fine on my development machine. I am using AD.NET Data Services to provide the data. When II deploy to my hosted server (DiscountASP.NET), I am getting the error:

    "This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection."

    I have tried building my own custom DataServiceHostFactory to have only one base address (I have tried several versions I found on the net). My latest attempt seemed to "almost" work, but I got an error that the was no entry point defined.

    Since I cannot see the actual contract for the ADO.NET Data Service, I am having a hard time figuring out how to overcome this issue.

    Does anyone have any suggestions?

    bill burrows
    Wednesday, February 11, 2009 8:56 PM

Answers

  • Hi Bill,
     I am posting an extract from our EMail conversation so that anyone who runs across this thread knows how we solved this .
     Bill also posted the other steps we followed here : http://www.myvbprof.com/2007_Version/Silverlight_CRUD.aspx

    <Emai blurb>

    The web servers hosting the www.myvbprof.com also host a number of other websites ,

    because of this , the web server has multiple host headers configured to listen on port 80 .

     

    Now , when IIS invokes the host for the WCF service (WAS), it passes all the possible address end points that the service can bind to & listen on .

     

    In our case ,

    public DataServiceHost(Type serviceType, Uri[] baseAddresses)

                : base(serviceType, baseAddresses)

     

    Which means that if the webhost has another website hosted on the same machine called www.myCSharpProf.com

     

    IIS passes along

     

    new DataServiceHost(Type serviceType, new Uri[]{

    new Uri(“http://www.myvbprof.com),

    new Uri(“http://www.myCSharpProf.com)

    });

     

    To WAS.

     

    Now , since the Windows Activation Service that hosts the WCF service supports only one base address for each protocol ,

    and IIS passes in 2 base addresses , we get the argument exception that looks like this :

     

    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

    The resolution is to specify the base address for any WCF Service hosted in your website via the  baseAddressPrefixFilters setting in System.ServiceModel section of web.config.

     

    Ex: for this case , the web.config should look like :

     

    Change    ln 154 from “<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>”

     

    To

     

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">

      <baseAddressPrefixFilters>

          <add prefix="http://www.myvbprof.com"/>

      </baseAddressPrefixFilters>

    </serviceHostingEnvironment>

     

     

    This should resolve the problem .

     

    References :

    http://blogs.msdn.com/wenlong/archive/2005/11/14/hosting-an-indigo-wcf-service.aspx

     

     

    </Email blurb>

    Saturday, March 28, 2009 7:45 PM
    Moderator