473,322 Members | 1,562 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,322 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 1414

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.