title: ASP.Net Membership provider in WCF (WebHttpBinding)
body: <p>I'm developping a <strong>WPF</strong> application that needs authentification. I want to use the <strong>client application services</strong> to use the <strong>ASP.Net Membership Provider</strong> (see this <a href="http://aspalliance.com/1596_Client_Application_Services__Part_2.7" rel="nofollow noreferrer">link</a> if you don't know what I'm talking about). Actually, I made my own provider based on the MembershipProvider. It works perfectly with a ASP.Net projet. </p>
  
  <p>But now, I don't want my authentification to be hosted in a ASP.Net projet anymore, but to be in WCF.</p>
  
  <p>So, I did a <strong>WCF service</strong> and used a <strong>WebHttpBinding</strong>. Everything is ok, until the login is entered. The call is made to the service, no doubt about it, but nothing happens. In fact, it's like the call has been made but isn't <em>served</em>. 
  I can confirm it because I used the service trace viewer to log all the messages to the service. </p>
  
  <p>Eventually, I receive a timeout with the message : </p>
  
  <blockquote>
    <p>The incoming HTTP request's URI '<a href="http://localhost:21200/Authentication_JSON_AppService.axd/Login" rel="nofollow noreferrer">http://localhost:21200/Authentication_JSON_AppService.axd/Login</a>' does not match any service operation.</p>
  </blockquote>
  
  <p><br /><br>
  It's like if the Provider isn't taking the call or receive it. I really don't know where to look. I've done my research but I did'nt find similar examples. Here's my settings :  </p>
  
  <p><strong>1. Config file for the Membership Provider</strong> (working in a ASP.NET project)</p>
  
  <pre><code>&lt;system.web.extensions&gt;
  &lt;scripting&gt;
    &lt;webServices&gt;
      &lt;authenticationService enabled="true" /&gt;
      &lt;roleService enabled="true" /&gt;
    &lt;/webServices&gt;
  &lt;/scripting&gt;
  &lt;/system.web.extensions&gt;
  &lt;system.web&gt;
    &lt;authentication mode="Forms" /&gt;
    &lt;authorization&gt;
      &lt;allow users="*"/&gt;
    &lt;/authorization&gt;
    &lt;membership defaultProvider="FooMembershipProvider"&gt;
      &lt;providers&gt;
        &lt;add name="FooMembershipProvider" type="Foo.Web.Security.FooMembershipProvider, Foo.Web" /&gt;
      &lt;/providers&gt;
    &lt;/membership&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p><br /><br>
  <strong>2. Config file for my application, section service</strong> (working if I use the ASP.NET project)</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt;
  
    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name="WebBehavior"&gt;
          &lt;webHttp /&gt;
          &lt;enableWebScript /&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="WebBehavior"&gt;
          &lt;serviceMetadata httpGetEnabled="true" httpGetUrl="" /&gt;
          &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
  
  
    &lt;bindings&gt;
      &lt;basicHttpBinding&gt;
        &lt;binding name="basicHttpMode"&gt;
          &lt;security mode="None" /&gt;
        &lt;/binding&gt;
      &lt;/basicHttpBinding&gt;
      &lt;webHttpBinding&gt;
        &lt;binding name="webHttpMode"&gt;
          &lt;security mode="None" /&gt;
        &lt;/binding&gt;
      &lt;/webHttpBinding&gt;
    &lt;/bindings&gt;
  
    &lt;services&gt;
      &lt;service behaviorConfiguration="WebBehavior"
             name="Foo.Security.Business.Manager.Wcf.Host.SecurityManager"&gt;
  
        &lt;endpoint address=""
                binding="webHttpBinding"
                contract="Foo.Security.Business.Contract.ISecurityContract"
                behaviorConfiguration="WebBehavior"
                bindingConfiguration="webHttpMode" /&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="http://localhost:21200" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
      &lt;/service&gt;
    &lt;/services&gt;
  &lt;/system.serviceModel&gt;  
  </code></pre>
  
  <p><br />
  <strong>3. Config file for my application, section call of the service</strong> (working if I use the ASP.NET project)</p>
  
  <pre><code>&lt;membership defaultProvider="ClientAuthenticationMembershipProvider"&gt;
     &lt;providers&gt;
       &lt;add name="ClientAuthenticationMembershipProvider"  type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
           serviceUri="http://localhost:21200/Authentication_JSON_AppService.axd"
           credentialsProvider="Foo.Windows.LoginWindow, Foo.Windows" /&gt;
  
       &lt;add name="FooMembershipProvider"
           type="Foo.Security.Business.Provider.FooMembershipProvider, Foo.Security.Business"
           serviceUri="http://localhost:21200/Authentication_JSON_AppService.axd"
           credentialsProvider="Foo.Windows.LoginWindow, Foo.Windows" /&gt;
     &lt;/providers&gt;
   &lt;/membership&gt;
   &lt;roleManager defaultProvider="ClientRoleProvider" enabled="true"&gt;
     &lt;providers&gt;
       &lt;add name="ClientRoleProvider"
           type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
           serviceUri="http://localhost:21200/Role_JSON_AppService.axd"
           cacheTimeout="86400" /&gt;
     &lt;/providers&gt;
   &lt;/roleManager&gt;  
  </code></pre>
  
  <p><br />
  If anyone could give me some hints where to look, it would be appreciated. Thanks.</p>