【发布时间】:2012-08-30 23:05:24
【问题描述】:
我正在使用服务参考使用 Web 服务。
我使用 ToString() 转换了结果返回。
using (ConnectClient client = new ConnectClient("ESConnect"))
{
result = client.actiService("ssss", "sss", "sss").ToString();
我使用 xml.linq 来读取 xml。
using (XmlReader reader = XmlReader.Create(new StringReader(result)))
我收到以下错误:
The content type text/plain 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.
编辑:
Web 服务是使用 Apache Axis SOAP 创建的。
【问题讨论】:
-
请添加actiService方法代码
-
在“结果”行添加一个断点并检查从服务中传入的内容。似乎它没有返回格式良好的 xml。
-
它确实返回了一个有效的 xml,但可能标头没有告诉它是一个 xml?
-
我不能提供actiService代码,因为它是第三方解决方案。
标签: c# linq-to-xml axis