473,721 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

soap serialization problems

AA
Hello
I am having problems with a very simple serialization :(

I download the schema
http://www.3gpp.org/ftp/Specs/archiv.../REL-5-MM7-1-0

and execute the xsd.exe for create the classes.

I load the file created in my project but when I try to serialize...

'-------------------------------------------
Dim reqSubmit As New submitReqType
Dim fs As New MemoryStream
Dim formatter As New SoapFormatter

formatter.Seria lize(fs, reqSubmit)
Console.WriteLi ne(System.Text. Encoding.Defaul t.GetString(fs. ToArray))
fs.Close()
'-------------------------------------------

this error occur...

< Failed to serialize. Reason: The type mm7.submitReqTy pe in Assembly mm7,
Version=1.0.156 5.20175, Culture=neutral , PublicKeyToken= null is not marked
as serializable. >
If that is true, how can I tell to the xsd.exe that mark as Serializable
when he create the clases?

Thanks a lot
AA
Nov 12 '05 #1
3 4851
Runtime serialization is not the same thing as XML serialization. XSD will
create types that can be serialized using the XML serializer. The
SoapFormatter class is used for runtime serialization, and requires you to
add the Serializable attribute to your types.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
"AA" <aa@personal.ne t.py> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello
I am having problems with a very simple serialization :(

I download the schema
http://www.3gpp.org/ftp/Specs/archiv.../REL-5-MM7-1-0
and execute the xsd.exe for create the classes.

I load the file created in my project but when I try to serialize...

'-------------------------------------------
Dim reqSubmit As New submitReqType
Dim fs As New MemoryStream
Dim formatter As New SoapFormatter

formatter.Seria lize(fs, reqSubmit)
Console.WriteLi ne(System.Text. Encoding.Defaul t.GetString(fs. ToArray))
fs.Close()
'-------------------------------------------

this error occur...

< Failed to serialize. Reason: The type mm7.submitReqTy pe in Assembly mm7,
Version=1.0.156 5.20175, Culture=neutral , PublicKeyToken= null is not marked
as serializable. >
If that is true, how can I tell to the xsd.exe that mark as Serializable
when he create the clases?

Thanks a lot
AA

Nov 12 '05 #2
AA
Thanks!

Now... when I run the serializer the output is
<q1:Envelope
xmlns:q1="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/sc
hema/REL-5-MM7-1-0">
<q1:Header>
<q1:Transaction ID>tranasaction IDDDD</q1:TransactionI D>
</q1:Header>
<q1:Body>
<q1:MM7Version> 5.3.0</q1:MM7Version>
<q1:MessageClas s>Personal</q1:MessageClass >
<q1:Subject>Hol a</q1:Subject>
<q1:Content href="http://www.personal.co m.py" allowAdaptation s="true" />
</q1:Body>
</q1:Envelope>
How can I change the "q1" prefix for other prefix like "env"

Thanks
"Mickey Williams" <my first name at servergeek.com> wrote in message
news:eX******** ******@TK2MSFTN GP12.phx.gbl...
Runtime serialization is not the same thing as XML serialization. XSD will
create types that can be serialized using the XML serializer. The
SoapFormatter class is used for runtime serialization, and requires you to
add the Serializable attribute to your types.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
"AA" <aa@personal.ne t.py> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello
I am having problems with a very simple serialization :(

I download the schema

http://www.3gpp.org/ftp/Specs/archiv.../REL-5-MM7-1-0

and execute the xsd.exe for create the classes.

I load the file created in my project but when I try to serialize...

'-------------------------------------------
Dim reqSubmit As New submitReqType
Dim fs As New MemoryStream
Dim formatter As New SoapFormatter

formatter.Seria lize(fs, reqSubmit)
Console.WriteLi ne(System.Text. Encoding.Defaul t.GetString(fs. ToArray)) fs.Close()
'-------------------------------------------

this error occur...

< Failed to serialize. Reason: The type mm7.submitReqTy pe in Assembly mm7, Version=1.0.156 5.20175, Culture=neutral , PublicKeyToken= null is not marked as serializable. >
If that is true, how can I tell to the xsd.exe that mark as Serializable
when he create the clases?

Thanks a lot
AA


Nov 12 '05 #3
"AA" <aa@personal.ne t.py> wrote in message
news:eg******** ********@TK2MSF TNGP11.phx.gbl. ..
How can I change the "q1" prefix for other prefix like "env"


Given a type that's XML-homed in a namespace:

[XmlRoot(Namespa ce="http://schemas.serverg eek.com/2004/4/eventing")]
public class X
{
public string Thing1 = "Foo";
public string Thing2 = "Bar";
}

You can cause a specific prefix to be used with the
XmlSerializatio nNamespaces class, like this:

static string SerializeThingT oXml(object thing)
{
XmlSerializerNa mespaces xsn = new XmlSerializerNa mespaces();
xsn.Add("sg", "http://schemas.serverg eek.com/2004/4/eventing");

StringWriter stringWriter = new StringWriter();
XmlSerializer serializer = new XmlSerializer(t hing.GetType()) ;
serializer.Seri alize(stringWri ter, thing, xsn);
return stringWriter.To String();
}

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
Nov 12 '05 #4

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

Similar topics

0
1594
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 Class IRMHeader Inherits SoapHeader <System.Xml.Serialization.XmlText()> _
0
1443
by: craig | last post by:
Hi, I'm new to all this and having tremendous difficulty trying to deserialize the following: <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header><TransactionID xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0" soap-env:mustUnderstand="1">-1433961100312413552</TransactionID></soap-env:Header><soap-env:Body><SubmitReq
8
6309
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. Is there a document, or can some one list those types that are not serializable and the syntax for converting them? Thanks
0
2244
by: Cleo | last post by:
Hi, I am trying to call a WebService Method written in Weblogic from VB.NET and I am getting the following error. I am using SOAP Caal s from VB.NET. Please find the wsdl file and my code. Any help would really be appreciated. Thx
3
9795
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet deserialization routines to put the content in a generic object array (object) BUT the content is supposed to...
0
4669
by: Daniel Thune, MCSE | last post by:
I am having a problem with formatting a SOAP Header in a .Net client. The client calls a Java Axis 1.1 based web service. In order to authenticate the caller, the web service call is intercepted by another web service that validates a security token in the header. I have pasted my current SOAP message that my code sends as captured from a trace function that I added. Below that is a sample SOAP message that the developer of the web...
0
2639
by: jennifer.perkins | last post by:
I've seen a couple posts by people having similar problems, but the suggested solutions I've tried so far haven't worked. I'm using a SOAP client in VB.Net (constructed by wsdl.exe) and the third party web service it's consuming is served by Axis. The request messages my client sends are processed fine by the server, and the SOAP response is making its way to my client - but when .Net finishes processing the message I end up with an...
3
10294
by: JRey | last post by:
Does .Net generate the classes for Faults when they are specified in the WSDL. I tried defining them and then generating a proxy, and it did not appear to do it. On the Java side it did generate the class and the ability to serialize that class when putting it on the wire. I was hoping a .Net client would create the appropriate exception class defined in the WSDL and deserialize the message into the appropriate exception class.
3
9433
by: Siva | last post by:
Hi all, I want to Convert a WSDL to a SOAP message. Is there any way to do this. I am using .NET 2.0 Thanks in Advance Siva
5
3071
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I've got a .Net client to a soap service that works for the most part, but there are a couple of things I'd like to improve: 1) the first request to the client wrapper always takes 12-15 seconds even though the web server shows < a half second spent on the request. What takes so much time for the client wrapper to warm up? All subsequent requests, even to the same method, take the half second.
0
9365
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9127
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9056
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8002
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6664
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4748
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2127
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.