Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList Serialize Issue -> Structured ArrayList
Serialize Issue -> Structured ArrayList
Go Back  Xtreme Visual Basic Talk > > > Serialize Issue -> Structured ArrayList


Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2005, 10:36 AM
UTNeflyte UTNeflyte is offline
Newcomer
 
Join Date: Dec 2004
Posts: 10
Question Serialize Issue -> Structured ArrayList


Hello,

Having a weird problem here when serializing my structured arraylist to XML...
Below is the Structure:

Code:
<Serializable()> Public Structure TUser Public s_Name As String Public s_UserID As String Public s_Password As String Public Sub New(ByRef Name, ByVal UserID, ByVal Password) s_Name = Name s_UserID = UserID s_Password = Password End Sub Public Property Name() As String Get Return s_Name End Get Set(ByVal Value As String) s_Name = Value End Set End Property Public Property UserID() As String Get Return s_UserID End Get Set(ByVal Value As String) s_UserID = Value End Set End Property Public Property Password() As String Get Return s_Password End Get Set(ByVal Value As String) s_Password = Value End Set End Property End Structure
Here's the ArrayList Call

Code:
Public TUserList As New ArrayList
But, when I call the serialization as below, the XML is a bit screwed up...
Code:
Dim u1 As New TUser Dim fs As New FileStream(Application.StartupPath & "\test.xml", FileMode.Open, FileAccess.Read) Dim XMLf As New Soap.SoapFormatter u1 = CType(XMLf.Deserialize(fs), TUser) fs.Close()
The top of XML comes out as all screwed up... (Line 4 to 16 approx...)

Code:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:ArrayList id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Collections" id="ref-6">0<


"

1"
1>
0<
1>
50<

>
Administrator2<

>Admin3
<Bob
>0
<_items>0<_size id="ref-2" SOAP-ENC:arrayType="xsd:anyType[16]" xsi:type="a3:TUser" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/TrainingSoftware/TrainingSoftware%2C%20Version%3D1.0.1843.24755%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull" id="ref-4">
<_size>
<_version id="ref-5">0<_version>
</a1:ArrayList>
<SOAP-ENC:Array>
<item>
<s_Name>Administrator1</s_Name>
<s_UserID>Admin1</s_UserID>
<s_Password>Admin2</s_Password>
Anyone knows what I did wrong?

Thank you
UTN
Reply With Quote
  #2  
Old 01-17-2005, 04:58 PM
MKoslof's Avatar
MKoslofSerialize Issue -&gt; Structured ArrayList MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Look at this link:

http://home.att.net/~codeLibrary/XML/filter_p_.htm

At the bottom, it shows a brief example of using the XML.Serialization.XmlSerializer class
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
 
Serialize Issue -&gt; Structured ArrayList
Serialize Issue -&gt; Structured ArrayList
 
-->