473,807 Members | 2,853 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 4857
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
1597
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
1448
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
6319
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
2252
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
9798
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
4673
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
2647
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
10297
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
9439
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
3077
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
9720
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
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...
1
10374
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,...
1
7650
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
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.