本文介绍了Web服务仅返回XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用服务参考来使用Web服务.
I am consuming a web services using Service Reference.
我使用ToString()转换了返回的结果.
I converted the result return using ToString().
using (ConnectClient client = new ConnectClient("ESConnect"))
{
result = client.actiService("ssss", "sss", "sss").ToString();
我使用xml.linq来读取xml.
The I use xml.linq to read the 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创建的.
The web service is created using Apache Axis SOAP.
推荐答案
如果您只是解析XML字符串,则可以尝试 XDocument.Load
If you're just parsing an XML string you could try XDocument.Load
这篇关于Web服务仅返回XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!