I want to deserialize a SOAP Header Element to a class using:
When the code is executed a get an exception 'There is an error in XML document (1, 2).'
The XmlElement from the SOAPHeader:
The Context Class:
I don't know what is going wrong. Can someone help me out here please?
Code:
XmlSerializer serializer = new XmlSerializer( typeof(Context)); Context context = serializer.Deserialize(new StringReader.xmlElementOuterXml))
The XmlElement from the SOAPHeader:
Code:
<Context CompanyName="Wervis Personeelsadvies en Automatisering" ProductSerial="00000000-0000-0000-0000-000000000005" xmlns="http://www.product.nl/" />
Code:
using System;
using System.Web.Services.Protocols;
namespace Wervis.Product.Dto
{
public class UserContext
{
private string companyName;
private String productSerial;
public string CompanyName
{
get { return companyName; }
set { companyName = value; }
}
public string ProductSerial
{
get { return productSerial; }
set { productSerial = value; }
}
}
}
Comment