views:

50

answers:

1

Hello I have an issue deploying my silverlight project to an existing website (normal website with aspx pages).

Everything works fine except that when silverlight tries to connect to the RIA service, it fails because the website is redirecting each time to the login page.

I found this on the web.config of the site that seems to make the trouble:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="AdWsSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
                receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://webserver/ADWS/AdWs.asmx" binding="basicHttpBinding"
            bindingConfiguration="AdWsSoap" contract="AdWs.AdWsSoap" name="AdWsSoap" />
    </client>


    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />


</system.serviceModel>

As you can see, the site is using a custom binding, and I guess that the RIA service pass through it and thats why it redirects to the login page of the site. I can't modify this custom binding (because it will affect many other applications that runs with this configuration).

Is there a way to solve this problem maybe specifying the RIA service not to use this custom binding??

I tried to create the .SVC file by myself and to override the AddEndpoints this way:

protected override void AddEndpoints()
    {
        foreach (Uri uri in this.BaseAddresses)
        {
            AddRestWithJsonEndpoint(uri);
        }
    }

But it keeps passing through the custom binding. Please help.

Thanks in advance.

A: 

After playing around for some time, I found out how to solve my issue:

First of all, everything depends on web.config and the tags it contains. For example, in my case, I was creating a separate config file for silverlight configurations, but at the end all I needed was to merge my silverlight's project web.config with the one I got on the main web site.

Second, pay attention to connection strings used around silverlight project, in my case, I got many connection strings in some layers around the project, so I forgot to copy a couple of the on the main web.config and that was the reason I was having errors.

Hope It helps somebody.

Bye.

lidermin

related questions