locked
Silverlight HTTPS issue RRS feed

  • Question

  • Hello

    I'm trying to access the WCF service from Silverlight. It works fine without SSL. When I enabled SSL using the following configuration, Visual Studio complains that "clientCredentialType" attribute is not declared. Any idea how to resolve this issue?

    <basicHttpBinding>

    <binding name="silverlightFaultEndPoint" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">

    <security mode="Transport">

    <transport clientCredentialType="None"/>

    </security>

    </binding>

    </basicHttpBinding>

    </bindings>

    <client>

    <endpoint address="https://TestServer/RoutingService.svc"

    binding="basicHttpBinding" bindingConfiguration="silverlightFaultEndPoint"

    contract="ServiceReference1.IZipCodeService" name="silverlightFaultEndPoint" />

    </client>

     

     

    Sunday, January 15, 2012 2:13 AM

Answers

  • Hi,

    by default clientCredentialType is None. So you don't need to configure it (and you can't configure it in Silverlight).

    It works fine without SSL.

    I suggest you to change the clientaccesspolicy.xml:

    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="http://*"/>
    <domain uri="https://*"/>
    </allow-from>
    <grant-to>
    <resource include-subpaths="true" path="/"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>

    Then follow the step to enable https:

    http://www.codeproject.com/KB/WCF/7stepsWCF.aspx

    Hope helpful.

     

     

    Tuesday, January 17, 2012 12:33 AM

All replies

  • Hi,

    by default clientCredentialType is None. So you don't need to configure it (and you can't configure it in Silverlight).

    It works fine without SSL.

    I suggest you to change the clientaccesspolicy.xml:

    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="http://*"/>
    <domain uri="https://*"/>
    </allow-from>
    <grant-to>
    <resource include-subpaths="true" path="/"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>

    Then follow the step to enable https:

    http://www.codeproject.com/KB/WCF/7stepsWCF.aspx

    Hope helpful.

     

     

    Tuesday, January 17, 2012 12:33 AM
  • Hello,

     

    Below is the working example code i have used recently: Please check if you are making any mistake:

    <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpsGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpEndpointBinding">
              <security mode="Transport">
                <transport clientCredentialType="Windows" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>

        <services>
          <service name="WCFWindowsBasicHttpBinding.Service1">
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding"
                name="BasicHttpEndpoint" contract="WCFWindowsBasicHttpBinding.IService1" />
          </service>
        </services>
      </system.serviceModel>

     

    Thanks

    Jaspreet Singh

    Wednesday, January 18, 2012 10:22 AM