Note that there are some explanatory texts on larger screens.

plurals
  1. POThe HTTP request was forbidden with client authentication scheme 'Anonymous' error, when adding WCF service reference
    primarykey
    data
    text
    <p>I am having an issue when trying to add a service reference to my winforms app. Both the service and the app are in the same solution and the service is using iisexpress with the default iisexpress development certificate installed. When I try to add the service reference I get the normal dialogs which find the service and then tell me the certificate is not signed by an authority. I "Ok" that message but then I get this error.</p> <blockquote> <p>The HTTP request was forbidden with client authentication scheme 'Anonymous'.</p> </blockquote> <p>The web.config for the web service is as follows</p> <p> </p> <pre><code> &lt;appSettings&gt; &lt;add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.5" /&gt; &lt;httpRuntime targetFramework="4.5" /&gt; &lt;authentication mode="Windows" /&gt; &lt;identity impersonate="false" /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="WsHttpBindingConfig"&gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;transport clientCredentialType="Certificate" /&gt; &lt;message clientCredentialType="UserName" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;protocolMapping&gt; &lt;add binding="wsHttpBinding" scheme="https" /&gt; &lt;/protocolMapping&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true" /&gt; &lt;!-- To browse web app root directory during debugging, set the value below to true. Set to false before deployment to avoid disclosing web app folder information. --&gt; &lt;directoryBrowse enabled="true" /&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>EDIT----------------</p> <p>I also get the following messagebox pop up after I accept the certificate.</p> <p>"There was an error downloading metadata from this address.Please verify that you have entered a valid address"</p> <p>Also I have found if I change</p> <pre><code>&lt;protocolMapping&gt; &lt;add binding="wsHttpsBinding" scheme="https" /&gt; &lt;/protocolMapping&gt; </code></pre> <p>to </p> <pre><code>&lt;protocolMapping&gt; &lt;add binding="basicHttpsBinding" scheme="https" /&gt; &lt;/protocolMapping&gt; </code></pre> <p>Then I can suddenly add the reference. Why is this? Surely I need it to be wsHttpsBinding?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload