Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.问题
甜苦瓜儿 2009-01-16 01:12:40 我写了一个WebPart,然后放于.aspx页中的WebPartZone中,webpart 中有如下代码:
String tfsServer = "http://digihail-geewu/";
tfsServer = tfsServer.Trim();
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsServer);
然后打开.aspx页是报下面错误:
Server Error in '/WebTest' Application.
--------------------------------------------------------------------------------
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<HTML dir="ltr">
<HEAD><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" /><meta HTTP-EQUIV="Expires" content="0" /><meta name="ROBOTS" content="NOHTMLINDEX" /><title>
Error
</title><link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/core.css?rev=5msmprmeONfN6lJ3wtbAlA%3D%3D"/>
<script type="text/javascript" language="javascript" src="/_layouts/1033/init.js?rev=VhAxGc3rkK79RM90tibDzw%3D%3D"></script>
<script type="text/javascript" language="javascript" src="/_layouts/1033/core.js?rev=F8pbQQxa4zefcW%2BW9E5g8w%3D%3D"></script>
<meta name="Robots" content="NOINDEX " />
<meta name="SharePointError" content=""/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
<form name="aspnetForm" method="post" action="../../_layouts/error.aspx" id="aspnetForm" onsubmit="return _spFormOnSubmitWrapper();">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTU2NjkxODU3M2RkD3o+/jNnvjb5O+uUofZnVNwFFoU=" />
<TABLE class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%">
<tr><td>
<table CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
<tr>
<td colspan=4 class="ms-globalbreadcrumb" align="right">
………………………………
--.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431431
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
Microsoft.TeamFoundation.Proxy.BisRegistrationServiceProxyWsdl.GetRegistrationEntries(String toolId) +54
Microsoft.TeamFoundation.Proxy.BisRegistrationProxy.GetRegistrationEntries(String toolId) +39
Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshMemoryCache() +90
Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshCachesIfNeeded(Boolean direct) +77
Microsoft.TeamFoundation.Proxy.BisRegistrationService.GetRegistrationEntries(String toolId) +17
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.GetMiddleTierUrls(String& serverUrl, String& configurationSettingsUrl) +68
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal() +68
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITeamFoundationServerObject.Initialize(TeamFoundationServer teamFoundationServer) +85
Microsoft.TeamFoundation.Client.TeamFoundationServer.CreateITFSObjectInstance(Assembly assembly, String fullName) +111
Microsoft.TeamFoundation.Client.TeamFoundationServer.GetService(Type serviceType) +359
AddWorkItem.AddWorkItem.CreateChildControls() in E:\WICountWebPart\AddWorkItem\AddWorkItem.cs:70
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053