Web service return only XML

点点圈 提交于 2019-12-13 06:07:02

问题


I am consuming a web services using Service Reference.

I converted the result return using ToString().

using (ConnectClient client = new ConnectClient("ESConnect"))
                {
                    result = client.actiService("ssss", "sss", "sss").ToString();

The I use xml.linq to read the xml.

using (XmlReader reader = XmlReader.Create(new StringReader(result)))

I get the following error:

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.    

EDITED:

The web service is created using Apache Axis SOAP.


回答1:


If you're just parsing an XML string you could try XDocument.Load



来源:https://stackoverflow.com/questions/12294807/web-service-return-only-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!