SharePoint, WCF and Anonymous Access

Does WCF Service for SharePoint provide anonymous access?

We have an application page that calls a service using Ajax.Net, if Anon Access is disabled then we get a request for username and password, if enabled then everything is fine.

We are not using a WCF client, it is just called by the scripter

<configuration>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding
          name="webHttpBinding_DataSources"
          maxBufferSize="5242880"
          maxReceivedMessageSize="5242880" />
      </webHttpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior
          name="ServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior
          name="ServiceBehavior">
          <serviceMetadata
            httpGetEnabled="true"
            httpGetUrl="" />
          <serviceDebug
            includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment
      aspNetCompatibilityEnabled="true"/>
    <services>
      <service
          name="XXXXXXXX.DataSources.Services.DataSourceHelper"
          behaviorConfiguration="ServiceBehavior">
        <endpoint
          address=""
          behaviorConfiguration="ServiceAspNetAjaxBehavior"
          binding="webHttpBinding"
          bindingConfiguration="webHttpBinding_DataSources"
          contract="XXXXXXXX.DataSources.Services.IDataSourceHelper" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

      

Thanks Phil

+1


a source to share


1 answer


I managed to get it to work with the following

<configuration>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding
          name="webHttpBinding_DataSources"
          maxBufferSize="5242880"
              maxReceivedMessageSize="5242880" >
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Ntlm" />
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior
          name="ServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior
          name="ServiceBehavior">
          <serviceMetadata
            httpGetEnabled="true"
            httpGetUrl="" />
          <serviceDebug
            includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment
      aspNetCompatibilityEnabled="true"/>
    <services>
      <service
          name="XXXXXXXXXX.DataSources.Services.DataSourceHelper"
          behaviorConfiguration="ServiceBehavior">
        <endpoint
          address=""
          behaviorConfiguration="ServiceAspNetAjaxBehavior"
          binding="webHttpBinding"
          bindingConfiguration="webHttpBinding_DataSources"
          contract="XXXXXXXXXX.DataSources.Services.IDataSourceHelper" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

      

I did an IISReset and had to close and reopen my browser for it to work though



Best wishes,

Phill

+2


a source







All Articles