简体   繁体   中英

Web service return only XML

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.

如果您只是解析XML字符串,则可以尝试XDocument.Load

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM