I have this SOAP response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ManageTerminalResponse xmlns="http://tpress.com.tx/">
<ManageTerminalResult xmlns:a="http://schemas.data." xmlns:i="http://www.w3.org//XMLSchema-instance">
<a:Checksum>2f28fff499684378d7fc89742773589a</a:Checksum>
<a:Message>Success</a:Message>
<a:ResponseCode>0000</a:ResponseCode>
<a:ServerDate>20200105</a:ServerDate>
<a:ServerTime>120931</a:ServerTime>
<a:WorkKey>QlJgkae+3+Sksgta52t/FoFL2eA/eeuvu3ek6aFgSp8dGdsBrIA==</a:WorkKey>
</ManageTerminalResult>
</ManageTerminalResponse>
</s:Body>
</s:Envelope>
I have created the class as shown below
{
[XmlRoot("Envelope", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
public class TResponse
{
public ResponseBody Body { get; set; }
}
public class ResponseBody
{
[XmlElement(ElementName = "ManageTerminalResponse", Namespace = "http://t.com.tw/")]
public ManagterminalResponse ManageTerminalResponse { get; set; }
}
public class ManagterminalResponse
{
[XmlElement(ElementName = "ManageTerminalResult",Namespace = "http://schemas.datacontract.http://www.w3.org/2001/XMLSchema-instance")]
public ManageTerminalRslt ManageTerminalResult { get; set; }
}
public class ManageTerminalRslt
{
[XmlElement(Namespace = "")]
public string Checksum { get; set; }
[XmlElement(Namespace = "")]
public string Message { get; set; }
[XmlElement(Namespace = "")]
public string ResponseCode { get; set; }
[XmlElement(Namespace = "")]
public string WorkKey { get; set; }
}
}
I need to pass the values from response to ManageTerminalRslt
class.
How can I perform the deserialization in .net 3.5 framework.
I referred this link. But for the XmlDeserializeFromString()
says that need to upgrade the c# version to 6.0.
Help me with other function/code to perform above task.