Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: simple xml de-serializer test

From: Andrew@-----------.---------.---
To: NULL
Date: 4/1/2008 1:58:00 AM

Hi,
I got a parse error "Parse Error, no assembly associated with Xml key _P1 
GetResultResponse" with this code:

 using System.Xml;
 using System.Xml.Serialization;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters.Soap;

 IFormatter formatter;
 FileStream fileStream = null;
 Object objectFromSoap = null;
  try
  {
    string filePath = @"C:\FileStore\Result.xml";            
    fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
    formatter = new SoapFormatter();
    objectFromSoap = formatter.Deserialize(fileStream); <-- error

    Console.Write(objectFromSoap.ToString());
    Console.ReadLine();
  }

Any advice ?

cheers
Andrew

"Andrew" wrote:

> Hi,
> 
> Thanks for your reply. From what I've read, the code is different for SOAP 
> Serialization, but for de-serialization, it's essentially the same. Am I 
> right ?
> 
> What I need to figure out is which is the SoapType, XMLRoot, XmlType, etc 
> tags...
> 
> cheers
> Andrew
> 
> "Martin Honnen" wrote:
> 
> > Andrew wrote:
> > 
> > > I modified the code to deserialize a larger xml file which goes something 
> > > like this:
> > > Is the code the same to de-serialize ?
> > > 
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > >   <soap:Body>
> > >     <GetResultResponse xmlns="http://Product/Books/Store/V2">
> > >       <InvestigationReport>
> > >         <ReportData xmlns="http://Product/Books/Store">
> > >           <ServiceProvider />
> > >           <RequestingParty>
> > >             <HcpId xmlns="http://Product/Books/General">
> > >               <IdValue>ABC001</IdValue>
> > >               <IdScheme>Requestor</IdScheme>
> > >               <IdType>Administrator</IdType>
> > >             </HcpId>
> > >         </DocumentData>
> > >       </InvestigationReport>
> > >     </GetResultResponse>
> > >   </soap:Body>
> > > </soap:Envelope>
> > 
> > That is SOAP so you might want to look into SOAP serialization 
> > <URL:http://msdn2.microsoft.com/en-us/library/564k8ys4(VS.80).aspx>
> > 
> > 
> > -- 
> > 
> > 	Martin Honnen --- MVP XML
> > 	http://JavaScript.FAQTs.com/
> > 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent