I have generated c# classes based on a soap response format.
What is the best and easiest way to map an incoming soap response to these classes?
Can you share a code example?
Hi Mieke
This example should help you out. Consider the following xml soap response:
You could use a free online tool to convert the response into C# classes. The result should be similar to this:
When you have the corresponding classes, use the System.Xml.Serialization.XmlSerializer to deserialize the "xml as string" into objects:
You could use System.Xml.Serialization.XmlSerializer for this. Some examples are available on the MS docs. Also note Microsoft released some important security risks to consider when using XmlSerializer, basically don't deserialize data you don't trust.