473,399 Members | 3,603 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,399 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 1417

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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.