xmlns=''> was not expected. - There is an error in XML document (2, 2)
问题 Im trying to deserialize the response from this simple web service Im using the following code: WebRequest request = WebRequest.Create("http://inb374.jelastic.tsukaeru.net:8080/VodafoneDB/webresources/vodafone/04111111"); WebResponse ws = request.GetResponse(); XmlSerializer s = new XmlSerializer(typeof(string)); string reponse = (string)s.Deserialize(ws.GetResponseStream()); 回答1: Declaring XmlSerializer as XmlSerializer s = new XmlSerializer(typeof(string),new XmlRootAttribute("response"));