Deploying WCF services

Discussion in 'ASP.NET WebServices' started by sk2010, Nov 23, 2010.

  1. Hi,
    I created a WCF service consumed by a silverlight project. The service , silverlight and the webapp all are in same solution. I deployed the service, the web.config, .svc files and the bin directory. My web.confog contains the following configuration for services and securtiy.


    <behaviors>
    <serviceBehaviors>
    <behavior name="MyServiceBehavior">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
    </serviceBehaviors>

    </behaviors>

    <services>
    <service behaviorConfiguration="MyServiceBehavior" name="XYZ.Services.Service1">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyBasicHttpBinding"
    name="Endpoint1" contract="XYZ.Services.IService1" />
    </service>

    <service behaviorConfiguration="MyServiceBehavior" name="XYZ.Services.Service2">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyBasicHttpBinding"
    name="Endpoint2" contract="XYZ.Services.IService2" />
    </service>

    </services>


    <binding name="MyBasicHttpBinding">
    <security mode ="None">
    <transport clientCredentialType="None" />
    </security>
    </binding>

    when i try to access the service, i got the error " Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. "

    then i changed the binding configuration in web.config as

    <binding name="MyBasicHttpBinding">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Windows"/>
    </security>
    </binding>
    when i try to access the service, its prompting for username and password.

    Please let me know, whenther I have to change the authentication for this service as "Anonymous" or for windows authentication, why its asking for username and password. What code changes I should do to acces this service without giving username and password? Please help
     

Share This Page