WCF Authorization Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • crm

    WCF Authorization Error

    Hi,
    I'm implementing my first WCF application. Everything works fine if I
    host it in the development web server, but when I add the virtual
    directory to IIS I start getting the following error:

    "System.Service Model.Security. MessageSecurity Exception: The HTTP
    request is unauthorized with client authentication scheme 'Anonymous'.
    The authentication header received from the server was
    'Negotiate,NTLM '."

    I get this error both in my own application and in the wcfTestClient.
    IIS is configured to use NT Authentication, and to allow anonymous
    access. I have an asmx file in the same project that I can access.

    I have two endpoints defined, one for basicHttpBindin g and one for
    wsHttpBinding. I have not changed the app.config from what was
    generated when adding the wcf webservice reference to my project.

    Code:
    Dim Service As New
    WcfService.ifcS erviceClient("B asicHttpBinding _ifcService")
    Dim objResult As clsTestObject = Service.GetTest Object

    Config
    <system.service Model>
    <bindings>

    <basicHttpBindi ng>
    <binding name="BasicHttp Binding_ifcServ ice"
    closeTimeout="0 0:01:00"
    openTimeout="00 :01:00" receiveTimeout= "00:10:00"
    sendTimeout="00 :01:00"
    allowCookies="f alse" bypassProxyOnLo cal="false"
    hostNameCompari sonMode="Strong Wildcard"
    maxBufferSize=" 65536" maxBufferPoolSi ze="524288"
    maxReceivedMess ageSize="65536"
    messageEncoding ="Text" textEncoding="u tf-8"
    transferMode="B uffered"
    useDefaultWebPr oxy="true">
    <readerQuotas maxDepth="32"
    maxStringConten tLength="8192" maxArrayLength= "16384"
    maxBytesPerRead ="4096"
    maxNameTableCha rCount="16384" />
    <security mode="None">
    <transport clientCredentia lType="None"
    proxyCredential Type="None"
    realm="" />
    <message clientCredentia lType="UserName "
    algorithmSuite= "Default" />
    </security>
    </binding>
    </basicHttpBindin g>

    <wsHttpBindin g>
    <binding name="WSHttpBin ding_ifcService "
    closeTimeout="0 0:01:00"
    openTimeout="00 :01:00" receiveTimeout= "00:10:00"
    sendTimeout="00 :01:00"
    bypassProxyOnLo cal="false" transactionFlow ="false"
    hostNameCompari sonMode="Strong Wildcard"
    maxBufferPoolSi ze="524288"
    maxReceivedMess ageSize="65536"
    messageEncoding ="Text" textEncoding="u tf-8"
    useDefaultWebPr oxy="true"
    allowCookies="f alse">
    <readerQuotas maxDepth="32"
    maxStringConten tLength="8192" maxArrayLength= "16384"
    maxBytesPerRead ="4096"
    maxNameTableCha rCount="16384" />
    <reliableSessio n ordered="true"
    inactivityTimeo ut="00:10:00"
    enabled="false" />
    <security mode="Message">
    <transport clientCredentia lType="Windows"
    proxyCredential Type="None"
    realm="" />
    <message clientCredentia lType="Windows"
    negotiateServic eCredential="tr ue"
    algorithmSuite= "Default"
    establishSecuri tyContext="true " />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>

    <client>
    <endpoint address="http://localhost/Service.svc"
    binding="wsHttp Binding"
    bindingConfigur ation="WSHttpBi nding_ifcServic e"
    contract="WcfSe rvice.ifcServic e"
    name="WSHttpBin ding_ifcService ">
    <identity>
    <dns value="localhos t" />
    </identity>
    </endpoint>
    <endpoint address="http://localhost/Service.svc/basic"
    binding="basicH ttpBinding"
    bindingConfigur ation="BasicHtt pBinding_ifcSer vice"
    contract="WcfSe rvice.ifcServic e"
    name="BasicHttp Binding_ifcServ ice" />
    </client>
    </system.serviceM odel>

    Please help.
    Thanks,
    Chris McKenzie
    Plenase
Working...