I have a web application where the users can upload a specific XML file, then i need to convert the XML file to a object which is expect in a webservice.
Code:
var document = new XmlDocument();
document.Load(@"C:\Desktop\CteWebservice.xml");
var serializer =new XmlSerializer(typeof(OCTE));
var octe = (OCTE)serializer.Deserialize(new StringReader(document.OuterXml));
var serviceClient = new WSServiceClient();
serviceClient.InsertOCTE(octe);
I get this error when i try to deserialize the xml document as a OCTE object:
< Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'> was not expect.
Obvious, the OCTE class doesn't have a Envelope property.
My question is, i need to include this tag in the OCTE class or i need to do something else in the client?