From what I've read on SOAP this is a SOAP message. I've tried using the soapformatter to de-serialize but to no avail. I know how to deSerialize a simple XML message. It is related ? <?xml version="1.0" encoding="utf-8" ?> - <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <HcpId xmlns="http://www.w3.org/2001/XMLSchema"> <IdValue>SEVA1H</IdValue> <IdScheme>Requestor</IdScheme> <IdType>Consultant</IdType> </HcpId> - <HcpName xmlns="http://www.myurl.uk/iws/General"> <UnstructuredName>THOMAS, Andrew</UnstructuredName> </HcpName> </soap:Body> </soap:Envelope> code: === string filePath = @"C:\Projects\IWS\Get.xml"; fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); formatter = new SoapFormatter(); objectFromSoap = formatter.Deserialize(fileStream); Console.Write(objectFromSoap.ToString()); Console.ReadLine(); Thanks.
Hi Andrew, It looks like your SOAP encoding in unwrapped format. Check out this link for more info: http://msdn.microsoft.com/en-us/library/ms750528.aspx This means you'll have more than one root element, which is not valid for XML documents (though since it is in a body it is technically valid when you get it; your downstream stuff will have problems). So basically you need to either read these types out separately, or wrap them in the SOAP encoding. When you say deserialize do you mean you want a class that maps to these or something so you can use it in .NET? Kind Regards, -Dan
thanks for your reply. well so far i've been trying to write a class that maps to these, but it's been rather time consuming as the original xml message is very long etc. It is also difficult to know wether my class is 100% correct or not. Is there an easier way to deserialize it ? cheers Andrew "Dan Rosanova" wrote: > Hi Andrew, > It looks like your SOAP encoding in unwrapped format. Check out this link > for more info: http://msdn.microsoft.com/en-us/library/ms750528.aspx > > This means you'll have more than one root element, which is not valid for > XML documents (though since it is in a body it is technically valid when you > get it; your downstream stuff will have problems). So basically you need to > either read these types out separately, or wrap them in the SOAP encoding. > > When you say deserialize do you mean you want a class that maps to these or > something so you can use it in .NET? > > Kind Regards, > -Dan