473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Serialization of Object with SOAP XML String Embedded

I am not sure the appropriate newsgroup for this question,...I have also posted this on the XML.SOAP foru

Within a VB.NET application, I have two objects that are serializable. The second object contains a string variable containing the SOAP Serialized XML of the first object. If I serialize the second object into a string, I get very strange results with the string. I am certain there is a bug somewhere in the .NET framework causing this. Below is sample VB code that illustrated the problem using hashtables. Run the code, and note the message in the messagebox. Then uncomment the one line commented out and again look at the message box. You will see the text concatenated after the serialized string is missing

Thanks, and please let me know if I need to provide further clarification on the issue or if there is a more appropriate newsgroup to post this

Code

Dim formatter As New System.Runtime.Serialization.Formatters.Soap.SoapF ormatte
Dim ms As New System.IO.MemoryStrea
Dim x, thisOtherClassString, SeralizedObject As Strin
Dim thisOtherClass As New Hashtabl
Dim thisClass As New Hashtabl

thisOtherClass.Add("AA", "DD"
thisOtherClass.Add("AX", "ED"
thisOtherClass.Add("UU", "FF"

formatter.Serialize(ms, thisOtherClass
thisOtherClassString = System.Text.Encoding.ASCII.GetString(ms.GetBuffer( )

thisClass.Add("CX", "CXZ"
'thisClass.Add(thisOtherClassString, "test") '<---uncomment this line and again look at the messagebox result
thisClass.Add("CX2", "CXZ2"
thisClass.Add("CX3", "CXZ3"

ms = New System.IO.MemoryStrea
formatter.Serialize(ms, thisClass
SeralizedObject = System.Text.Encoding.ASCII.GetString(ms.GetBuffer( )
x = "this is before the string " & SeralizedObject.Trim & " this is after the string

MessageBox.Show(x) '<---note the exact text returne
Jul 21 '05 #1
0 1418

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aaron | last post by:
I am not sure the appropriate newsgroup for this question,...I have also posted this on the XML.SOAP foru Within a VB.NET application, I have two objects that are serializable. The second object...
0
by: Stephan Moeller | last post by:
Hi NG, I serialize the following class over .net remoting: using System; using System.Collections; namespace JobServerLib {
0
by: DotNetJunkies User | last post by:
I need to send a header from my client. The heade need to have following format: <Header> <id>23</id> </Header> 1. I created a soap header: <System.Xml.Serialization.XmlRoot("id")> _ Public...
0
by: psy000 | last post by:
Hi, I have a C# web service client that talks to a JAVA application sever. I use AXIS to generate the WSDL file, use wsdl.exe to generate proxy stub c# code. When I try to use c# client connect...
5
by: Arjen | last post by:
Hello, Can somebody help me a little bit? I can't get it to work. Please see my code below... I have placed some comments like "// And whats next?". I'm sure that I have to code something...
2
by: Just D | last post by:
Hi, I need to write a serialization (to XML string) and restoring (from XML string) of a very complicated object. The object uses a few classes, one class has two ArrayLists, etc. The general...
4
by: Brian Keating | last post by:
wonder if anyone can help me here, i've a framework 1.1 dataset which i serialize in framework 1.1 and deserialize in framework 2.0. This is fine, problem is that i want to modify some of the...
0
by: umhlali | last post by:
I get the following exception when my VB.NET app calls a Java web service that returns an array of objects. The same call works for a single object though. So looks like there is no problem...
1
by: Dejan | last post by:
Hello! I need to make an ASP.NET XML Web Service serving as an assembly container. Web Service loads the assembly from a given file, and returns that assembly to the caller. Since ASP.NET...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.