Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grrr! Darn thing won't deserialize
Message
De
31/08/2003 15:15:30
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
SOAP
Divers
Thread ID:
00824911
Message ID:
00824959
Vues:
27
I will be working all weekend long :( My client went with a full page advertisement in today's paper promoting his upcoming Services. He'll be taking ticket orders by hand until I can get the bugs worked out of this thing.

I might have noticed the answer to the problem myself, but the sun coming up in the east was glaring up my laptop display! So I crashed for a few hours instead :) Now it's back to the grindstone.

>I'm glad that worked. Hope you're not working all weekend long. :)
>
>>She shoots, she scores!! Thanks a million, Cathi.
>>
>>>Hi Keith,
>>>
>>>You need to set the memory stream position back to 0 before you attempt to deserialize. The problem is that the position is still sitting at the end.
>>>
>>>>I'm getting an error - "The root element is missing." when attempting to deserialize from a memory stream into an object. What is driving me nuts is that I tested by saving the stream to a file right before serializing the object, and then saving the stream to a different file right before deserializing, and the files look structurally identical to me.
>>>>
>>>>The serialized file:
>>>>
>>>>  <?xml version="1.0" ?>
>>>>- <ArrayOfTicketPurchaseItem xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>>>- <TicketPurchaseItem>
>>>>- <EventItem>
>>>>  <Key>7</Key>
>>>>  <Value>High Holy Days (all services)</Value>
>>>>  </EventItem>
>>>>- <SectionItem>
>>>>  <Key>1</Key>
>>>>  <Value>VIP</Value>
>>>>  </SectionItem>
>>>>  <AdultAmount>250</AdultAmount>
>>>>  <ChildAmount>0</ChildAmount>
>>>>  <AdultQuantity>2</AdultQuantity>
>>>>  <ChildQuantity>1</ChildQuantity>
>>>>  </TicketPurchaseItem>
>>>>  </ArrayOfTicketPurchaseItem>
>>>>
>>>>And the file that I saved when trying to deserialize:
>>>>
>>>>  <?xml version="1.0" ?>
>>>>- <ArrayOfTicketPurchaseItem xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>>>- <TicketPurchaseItem>
>>>>- <EventItem>
>>>>  <Key>3</Key>
>>>>  <Value>Rosh Hashanah</Value>
>>>>  </EventItem>
>>>>- <SectionItem>
>>>>  <Key>2</Key>
>>>>  <Value>Reserved</Value>
>>>>  </SectionItem>
>>>>  <AdultAmount>75</AdultAmount>
>>>>  <ChildAmount>0</ChildAmount>
>>>>  <AdultQuantity>5</AdultQuantity>
>>>>  <ChildQuantity>2</ChildQuantity>
>>>>  </TicketPurchaseItem>
>>>>- <TicketPurchaseItem>
>>>>- <EventItem>
>>>>  <Key>7</Key>
>>>>  <Value>High Holy Days (all services)</Value>
>>>>  </EventItem>
>>>>- <SectionItem>
>>>>  <Key>2</Key>
>>>>  <Value>Reserved</Value>
>>>>  </SectionItem>
>>>>  <AdultAmount>175</AdultAmount>
>>>>  <ChildAmount>0</ChildAmount>
>>>>  <AdultQuantity>2</AdultQuantity>
>>>>  <ChildQuantity>2</ChildQuantity>
>>>>  </TicketPurchaseItem>
>>>>- <TicketPurchaseItem>
>>>>- <EventItem>
>>>>  <Key>3</Key>
>>>>  <Value>Rosh Hashanah</Value>
>>>>  </EventItem>
>>>>- <SectionItem>
>>>>  <Key>0</Key>
>>>>  <Value>Inner Circle</Value>
>>>>  </SectionItem>
>>>>  <AdultAmount>500</AdultAmount>
>>>>  <ChildAmount>0</ChildAmount>
>>>>  <AdultQuantity>1</AdultQuantity>
>>>>  <ChildQuantity>2</ChildQuantity>
>>>>  </TicketPurchaseItem>
>>>>- <TicketPurchaseItem>
>>>>- <EventItem>
>>>>  <Key>7</Key>
>>>>  <Value>High Holy Days (all services)</Value>
>>>>  </EventItem>
>>>>- <SectionItem>
>>>>  <Key>0</Key>
>>>>  <Value>Inner Circle</Value>
>>>>  </SectionItem>
>>>>  <AdultAmount>500</AdultAmount>
>>>>  <ChildAmount>0</ChildAmount>
>>>>  <AdultQuantity>5</AdultQuantity>
>>>>  <ChildQuantity>2</ChildQuantity>
>>>>  </TicketPurchaseItem>
>>>>  </ArrayOfTicketPurchaseItem>
>>>>
>>>>
>>>>Sorry about the lame IE formatting, but the source of the deserialization data is a Text field in a table that does not have any formatting at all.
>>>>
>>>>Has anyone had this missing root element problem already and can give me some pointers on how to avoid it?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform