Reputation: 2427
I'm trying to deserialize the following XML response into a c# object
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
Error message
</string>
Here is the object I'm trying to deserialize to. Not quite sure how to make the root element match the ErrorMessage
property
[Serializable]
public class QObject
{
[XmlElement("string")]
public string ErrorMessage { get; set; }
}
When I serialize a QObject
into a string, it looks like this
<?xml version="1.0" encoding="utf-16"?>
<QObject xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><string>test</string></QObject>
Upvotes: 1
Views: 878