SharePoint Browser Error

Was talking through a problem with another developer recently, who was having an error within the K2 Designer for Visual Studio.

The environment is a “semi-distributed” one, with the developer using a Vista laptop + Visual Studio – and then the K2 server & bits located on a server elsewhere.

The problem is this :

  • Open K2 Object Browser
  • Expand the SharePoint Server(s) node
  • Show the list of document libraries

The following error then appears :


Client found response content type of ‘text/html; charset=utf-8’, but expected ‘text/xml’.

It’s a huuuuge message box, with the contents actually looking like the HTML for a SharePoint “page”.


I’m guessing it’s trying to call a web service, and thinking that XML would/should be coming back, but it’s getting a page instead – ie. HTML.

The first thing to check is the configuration of the SharePoint server :

  • Open the K2 Object Browser
  • Right-click on the SharePoint Site URL node
  • Select “Edit Field…”


This shows the following dialog, with the name, description and URL :


As MythBusters would say – “well there’s your problem !!”

When entering the value for the SharePoint URL, “/Pages/default.aspx” was included also.

And so – within the K2 Designer code, there would be some code trying to call :

In fact, let’s go have a look into the LogFiles for IIS – to see. 



Yep – there’s the one that’s “wrong”…>


When viewing the “home page” for the site, it’s often tempting to just copy+paste the URL from the address bar – as this *IS* the site URL, right ?

Well – seems like K2 (and SharePoint itself) don’t trim off the “Pages” and “default.aspx” – nor should they, I guess.

So, the solution was simply to ensure that the URL entered was just the web application / site collection address :


And – yep, that works now :


And – let’s have a look into the IIS log (again) :


So – when configuring the “environment variables”, make sure you ONLY include the site URL – not the “page”.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s