SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a WCF WebService which connects to the Taxonomy service from SharePoint with a 'Service Reference' in Visual Studio 2010 to the https://localhost/sites/MYSITE/_vti_bin/TaxonomyClientService.asmx service.

But when calling the method GetTermSets(...) I do sometimes get this exception:

System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 52 bytes of the response were: 'No credentials are available in the security package'.

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Any idea why this happens ?

share|improve this question

It seems that when I switched to the old 2.0 .NET compatible 'Web Reference', the problem was solved.

public partial class Taxonomywebservice
  public Taxonomywebservice(BusinessConfig config) : base()
    base.Url = config.Taxonomy;
    base.Credentials = new NetworkCredential(config.UserName, config.Password, config.Domain);
    base.PreAuthenticate = true;

I don't have a good explanation for this, maybe the PreAuthenticate = true solves the issue ?

share|improve this answer
Same here (Visual Studio 2013, SharePoint 2013). – bzlm Sep 15 '14 at 8:36

Your Answer


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.