Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 22 Apr 2008 05:07:01 -0700,    group: microsoft.public.xml.soap        back       


How do I deSerialize this ?   
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.
date: Tue, 22 Apr 2008 05:07:01 -0700   author:   Andrew

RE: How do I deSerialize this ?   
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
date: Wed, 30 Apr 2008 11:13:00 -0700   author:   Dan Rosanova Dan

RE: How do I deSerialize this ?   
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
date: Thu, 1 May 2008 04:11:00 -0700   author:   Andrew

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us