Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp.net WCF and integrated Windows authentication and IIS 6.0
    text
    copied!<p>I have been struggling with this problem, read many questions, articles but could not solve it. so here I am.</p> <p>Webservice is within a website and I access it from a Console application [testing]. here is my Web.Config code</p> <pre><code> &lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="Services.CilsDataReceiveBehavior"&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="WindowsAuth"&gt; &lt;security mode="TransportCredentialOnly" &gt; &lt;transport clientCredentialType="Windows"/&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service behaviorConfiguration="Services.CilsDataReceiveBehavior" name="Services.CilsDataReceive"&gt; &lt;endpoint address="" binding="basicHttpBinding" name="BasicHttpEndpoint" bindingConfiguration="WindowsAuth" contract="Services.ICilsDataReceive" /&gt; &lt;endpoint address="mex" binding="webHttpBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Below is my code and app.config used in <strong>Console</strong> application.</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="BasicHttpBinding_ICilsDataReceive" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="None"&gt; &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://wgb01wa7002.worldwide.co.uk:44001/Services/CilsDataReceive.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICilsDataReceive" contract="ICilsDataReceive" name="BasicHttpBinding_ICilsDataReceive" /&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Below is the cs code</p> <pre><code>icDateList.titlesField = titles.ToArray(); var cilsDataReceiveClient = new CilsDataReceiveClient(); try { cilsDataReceiveClient.RecieveICDateList(icDateList); Console.WriteLine(" O_O Service saved the data O_O"); } catch (Exception exception) { cilsDataReceiveClient.Abort(); Console.WriteLine(exception.Message); throw; } finally { Console.Read(); } </code></pre> <p>error message is "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'."</p> <p>If a change my Console application app.config to</p> <pre><code>&lt;security mode="TransportCredentialOnly"&gt; &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; </code></pre> <p>I get below error "'http://wgb01wa7002.worldwide.co.uk:44001/Services/CilsDataReceive.svc' could not be activated. See the server's diagnostic trace logs for more information."</p> <p>I tried many things tries WsHttpBinding but i think that uses Https rather http.</p> <p>Could you please suggest something?</p> <p>Edit: if I access it from browser I get "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service."</p> <p>Edit 2: i tried with netTCPBinding and error changed "The provided URI scheme 'http' is invalid; expected 'https'. It seems I should not use it. Parameter name: via"</p> <p>Edit 3: I tried with wsHttpBinding and still i am getting errors. its like never ending errors.</p>
 

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