English 中文(简体)
客户端找到了文本/ html的响应内容类型, 但预期文本/ xml [重复]
原标题:Client found response content type of text/html , but expected text/xml [duplicate]
  • 时间:2012-05-25 18:43:23
  •  标签:
  • c#
  • asp.net
This question already has answers here:
Closed 12 years ago.

Possible Duplicate:
Client found response content type of text/html , but expected text/xml

我正在添加用户认证的网络参考。 此工程建立成功 。 但在此之后, 一旦我输入用户名和密码, 并输入登录按钮, 它会给出以下错误信息 。

“ 屏幕发现文本/ html的响应内容类型, 但预期文本/ xml

这是我的代码:

webservice.API c = new webservice.API();
var ret = c.checkAuth(new Guid("34343-kjk343-44343-3434"), UserName.Text, Password.Text);
if (ret.APIStatus.id == 1)
{
}
else
{
}

任何帮助都会感激不尽

问题回答

Infirefox 使用 Firebug 来查看网络服务出错之处, 因为似乎有些错误页面正在从网络服务中返回 。

如果您的网络工程和网络服务项目都与尝试调试应用程序的解决方案相同,您就会发现该服务正在发生什么。

The problem seems to be on the webservice side, not on your client app. Do you have control on the webservice? If so you should be able to verify that it correctly sends a response with Content-Type: text/xml

您还应当使用< a href=> http://www. fiddir2.com/ fiddler2/" rel="nofollow" > Fiddler2 来监测正在发生的情况,并检查发送和收到的请求和答复中的其他属性。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!