views:

164

answers:

1

I have this setup that works perfectly when using http.

A silverlight 3 client .net 4 WCF service hosted in IIS with basicHttpBinding and using integrated security on the site

When setting https to required on the website the setup stops working.

Using the wcftestclient on the uri I get the message: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. The remote server returned an error: (401) Unauthorized.

Maybe this makes sense because the wcftestclient does not pass credentials?

in the web.config the security mode for the service binding is set is set to 'Transport'.

The silverlight client is created like this:

        BasicHttpBinding basicHttpBinding = new BasicHttpBinding();

        basicHttpBinding.Security.Mode = BasicHttpSecurityMode.Transport;

        var serviceClient = new ImportServiceClient(basicHttpBinding, serviceAddress);

The service address is ofcourse starting with https:// And the silverlight client reports this error:

The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via

Remember, swithing it back to http (and setting security mode to 'TransportCredentialOnly' makes everything working again.

Is the setup I want even supported? If so, how should it be configured?

A: 

Turns out that the above setup does work. The key is

basicHttpBinding.Security.Mode = BasicHttpSecurityMode.Transport; 

In de client code, and

    <binding name="silverlightBinding" maxReceivedMessageSize="10485760">
      <security mode="Transport">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>

at the service end.

Somehow I was working with a xap file without the changes in the security mode. As soon as I used the newly compiled xap it started working.

Flores