Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am receiving the following error from my SharePoint 2010 service application:

The HTTP request was forbidden with client authentication scheme 'Anonymous'

This code is being thrown from the my channel.

 public string ConvertToTLForm(string inputDocument, string tipAndLeadLibrary, string siteCollectionURL)
{

    // execute the call against the service app
    ExecuteOnChannel("ConvertToTLForm",
        delegate(ITipAndLeadAPIContract channel)
        {
            channel.ConvertToTLForm(inputDocument, tipAndLeadLibrary, siteCollectionURL);
        });

    return "";
}

Anyone have any ideas on why this is being thrown? There are a few similar threads on stackoverflow.com but none of them seemed to provide the answers I was looking for.

Here is my client.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <client>
            <endpoint  address=""
                name="http"
                      binding="customBinding" bindingConfiguration="TLAPIServiceHttpBinding"
                      contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract" />
        </client>
        <bindings>
            <customBinding>
                <binding name="TLAPIServiceHttpBinding">

                    <security authenticationMode="IssuedTokenOverTransport" allowInsecureTransport="true" />
                    <textMessageEncoding>
                        <readerQuotas maxStringContentLength="204857600" maxArrayLength="209715200" />
                    </textMessageEncoding>
                    <httpTransport maxReceivedMessageSize="216268800" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
                </binding>
            </customBinding>
        </bindings>
    </system.serviceModel>
</configuration>

And my web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.web>
        <compilation debug="true" defaultLanguage="C#" />
    </system.web>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="TLAPITypeBehaviors" >
                    <serviceMetadata httpGetEnabled="true" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="AF.TipAndLeadAPI.TipAndLeadAPIServiceApplication" behaviorConfiguration="TLAPITypeBehaviors">
                <endpoint binding="customBinding" bindingConfiguration="TLAPIServiceHttpBinding"
                          contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract"
                          address="" />
            </service>
        </services>
        <bindings>
            <customBinding>
                <binding name="TLAPIServiceHttpBinding">
                    <security authenticationMode="IssuedTokenOverTransport" allowInsecureTransport="true" />
                    <textMessageEncoding>
                        <readerQuotas maxStringContentLength="2048576000" maxArrayLength="2097152000" />
                    </textMessageEncoding>
                    <httpTransport maxReceivedMessageSize="2162688" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
                </binding>
            </customBinding>
        </bindings>
    </system.serviceModel>
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="true" />
                <windowsAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</configuration>

Thank you.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Strange, I reverted my Virtual Machine to a previous state, executed the exact same code and everything worked fine. Still not sure why exactly I got the above error, perhaps something was lingering in my GAC or some old assembly wasn't getting full removed. If anyone has any thoughts, please share.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.