注册 登录
编程论坛 ASP.NET技术论坛

调用WebServers错误问题 和 text/plain text/xml 有关,高手来看看+++

hnczljt 发布于 2008-07-19 12:27, 2288 次点击
高手帮我解决下这个问题吧
我调用了一个WebServer的方法,然后报了这个错:

System.Exception: 客户端发现响应内容类型为“text/plain; charset=utf-8”,但应为“text/xml”。
请求失败,错误信息为:

--
System.InvalidOperationException: UNMPWS/Notify.asmx Web 服务方法名无效。
  at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
  at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

--.

我改了web.Config 里的文件,
<globalization requestEncoding="GB2312" responseEncoding="GB2312" fileEncoding="GB2312"/>
然后去掉<?xml version="1.0" encoding="utf-8" ?>里的encoding="utf-8"

但还是 报错。。。。

哪个大虾帮我解决下啊
2 回复
#2
hebingbing2008-07-20 10:49
你将代码贴出来看看,webservices和调用的都贴出来……
#3
hnczljt2008-07-20 13:53
回复 2# hebingbing 的帖子
webservices  是到网上的,我都没看,给我的就是这个接口,我调用时就报错了,
参数都是String,接口返回的是个类,类里就两个字段
1