473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to tell wsdl.exe/VS.NET to put [Serializable] on classes

Hi,

How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put
[Serializable] on imported classes?
For example, i fin your web service you use a class:
[Serializable]
class Data
{
}

and in your method you return this data, the automatically generated client
side proxy will not have the [Serializable]
attribute set. Is there anything that controls this behavior?


Nov 21 '05 #1
9 3813
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put
[Serializable] on imported classes?
For example, i fin your web service you use a class:
[Serializable]
class Data
{
}

and in your method you return this data, the automatically generated client side proxy will not have the [Serializable]
attribute set. Is there anything that controls this behavior?

Nov 21 '05 #2
The problem is that these classes are not Serializable across AppDomains
(Although XmlSerializer can serialize them just fine). And creating a class
that derives from these classes doesn't help either. Because even if you
mark derived class to be [Serializable] remoting this type still fails
because base class is not [Serializable]. So, one is forced into creating
exact duplicate classes with same fields and then copying data.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:ea******** ******@TK2MSFTN GP12.phx.gbl...
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put
[Serializable] on imported classes?
For example, i fin your web service you use a class:
[Serializable]
class Data
{
}

and in your method you return this data, the automatically generated

client
side proxy will not have the [Serializable]
attribute set. Is there anything that controls this behavior?



Nov 21 '05 #3
what is the problem you are trying to solve?

can you just modify the generated code to include the attribute you want?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:eu******** *******@TK2MSFT NGP10.phx.gbl.. .
The problem is that these classes are not Serializable across AppDomains
(Although XmlSerializer can serialize them just fine). And creating a
class
that derives from these classes doesn't help either. Because even if you
mark derived class to be [Serializable] remoting this type still fails
because base class is not [Serializable]. So, one is forced into creating
exact duplicate classes with same fields and then copying data.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:ea******** ******@TK2MSFTN GP12.phx.gbl...
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put
[Serializable] on imported classes?
For example, i fin your web service you use a class:
[Serializable]
class Data
{
}

and in your method you return this data, the automatically generated

client
side proxy will not have the [Serializable]
attribute set. Is there anything that controls this behavior?



Nov 21 '05 #4
> can you just modify the generated code to include the attribute you want?

Of course, but it will get reset with next update of the file. What's the
reason for proxy generators not to include [Serialzable] attribute or to
provide some control over it.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...
what is the problem you are trying to solve?

can you just modify the generated code to include the attribute you want?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:eu******** *******@TK2MSFT NGP10.phx.gbl.. .
The problem is that these classes are not Serializable across AppDomains
(Although XmlSerializer can serialize them just fine). And creating a
class
that derives from these classes doesn't help either. Because even if you
mark derived class to be [Serializable] remoting this type still fails
because base class is not [Serializable]. So, one is forced into creating
exact duplicate classes with same fields and then copying data.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:ea******** ******@TK2MSFTN GP12.phx.gbl...
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

How can one tell wsdl.exe/VS.NET web service proxy generatioon to to
put
[Serializable] on imported classes?
For example, i fin your web service you use a class:
[Serializable]
class Data
{
}

and in your method you return this data, the automatically generated
client
side proxy will not have the [Serializable]
attribute set. Is there anything that controls this behavior?





Nov 21 '05 #5
I don't know the answer to those questions.
sorry.

"Developer" <lf@nospam.nosp am> wrote in message
news:er******** ******@TK2MSFTN GP12.phx.gbl...
can you just modify the generated code to include the attribute you want?


Of course, but it will get reset with next update of the file. What's the
reason for proxy generators not to include [Serialzable] attribute or to
provide some control over it.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...
what is the problem you are trying to solve?

can you just modify the generated code to include the attribute you want?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:eu******** *******@TK2MSFT NGP10.phx.gbl.. .
The problem is that these classes are not Serializable across AppDomains
(Although XmlSerializer can serialize them just fine). And creating a
class
that derives from these classes doesn't help either. Because even if you
mark derived class to be [Serializable] remoting this type still fails
because base class is not [Serializable]. So, one is forced into
creating
exact duplicate classes with same fields and then copying data.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:ea******** ******@TK2MSFTN GP12.phx.gbl...
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
> Hi,
>
> How can one tell wsdl.exe/VS.NET web service proxy generatioon to to
> put
> [Serializable] on imported classes?
> For example, i fin your web service you use a class:
> [Serializable]
> class Data
> {
> }
>
> and in your method you return this data, the automatically generated
client
> side proxy will not have the [Serializable]
> attribute set. Is there anything that controls this behavior?
>
>
>
>




Nov 21 '05 #6
Al
Why don't you inherit from the proxy class and use attributes in this class?

"Developer" wrote:
can you just modify the generated code to include the attribute you want?


Of course, but it will get reset with next update of the file. What's the
reason for proxy generators not to include [Serialzable] attribute or to
provide some control over it.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...
what is the problem you are trying to solve?

can you just modify the generated code to include the attribute you want?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:eu******** *******@TK2MSFT NGP10.phx.gbl.. .
The problem is that these classes are not Serializable across AppDomains
(Although XmlSerializer can serialize them just fine). And creating a
class
that derives from these classes doesn't help either. Because even if you
mark derived class to be [Serializable] remoting this type still fails
because base class is not [Serializable]. So, one is forced into creating
exact duplicate classes with same fields and then copying data.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:ea******** ******@TK2MSFTN GP12.phx.gbl...
no, I don't think so.
what is the problem you are trying to solve?
Are there ill-effects from this?

-D

"Developer" <lf@nospam.nosp am> wrote in message
news:e2******** ******@TK2MSFTN GP09.phx.gbl...
> Hi,
>
> How can one tell wsdl.exe/VS.NET web service proxy generatioon to to
> put
> [Serializable] on imported classes?
> For example, i fin your web service you use a class:
> [Serializable]
> class Data
> {
> }
>
> and in your method you return this data, the automatically generated
client
> side proxy will not have the [Serializable]
> attribute set. Is there anything that controls this behavior?
>
>
>
>




Nov 21 '05 #7
Al,
Why don't you inherit from the proxy class and use attributes in this

class?

That wouldn't work. He probably needs the Serializable attribute on the
message classes, not on the proxy itself.

--
Tomas Restrepo
to****@mvps.org
Nov 21 '05 #8
I need Serializable attribute on the various structs that are pulled in with
web service proxy.
i.e.:
public class Service1 : System.Web.Serv ices.Protocols. SoapHttpClientP rotocol
{}

/// <remarks/>
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace=http://tempuri.org/)]
<<<-------------I want [Serializable] here
public class Data {}
And you can't do the following when remoting the type:
[Serializable]
class Data2: Data{}

Not going to work.
"Al" <Al@discussions .microsoft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
Why don't you inherit from the proxy class and use attributes in this
class?

"Developer" wrote:
> can you just modify the generated code to include the attribute you
> want?


Of course, but it will get reset with next update of the file. What's the
reason for proxy generators not to include [Serialzable] attribute or to
provide some control over it.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...
> what is the problem you are trying to solve?
>
> can you just modify the generated code to include the attribute you
> want?
>
> -D
>
> "Developer" <lf@nospam.nosp am> wrote in message
> news:eu******** *******@TK2MSFT NGP10.phx.gbl.. .
>> The problem is that these classes are not Serializable across
>> AppDomains
>> (Although XmlSerializer can serialize them just fine). And creating a
>> class
>> that derives from these classes doesn't help either. Because even if
>> you
>> mark derived class to be [Serializable] remoting this type still fails
>> because base class is not [Serializable]. So, one is forced into
>> creating
>> exact duplicate classes with same fields and then copying data.
>>
>> "Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in
>> message
>> news:ea******** ******@TK2MSFTN GP12.phx.gbl...
>>> no, I don't think so.
>>> what is the problem you are trying to solve?
>>> Are there ill-effects from this?
>>>
>>> -D
>>>
>>> "Developer" <lf@nospam.nosp am> wrote in message
>>> news:e2******** ******@TK2MSFTN GP09.phx.gbl...
>>>> Hi,
>>>>
>>>> How can one tell wsdl.exe/VS.NET web service proxy generatioon to to
>>>> put
>>>> [Serializable] on imported classes?
>>>> For example, i fin your web service you use a class:
>>>> [Serializable]
>>>> class Data
>>>> {
>>>> }
>>>>
>>>> and in your method you return this data, the automatically generated
>>> client
>>>> side proxy will not have the [Serializable]
>>>> attribute set. Is there anything that controls this behavior?
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>




Nov 21 '05 #9
> I need Serializable attribute on the various structs that are pulled in
with
web service proxy.
i.e.:
public class Service1 : System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {}

/// <remarks/>
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace=http://tempuri.org/)]
<<<-------------I want [Serializable] here
public class Data {}


I'm happy to report that the latest version of WSContract First from
Christian Weyer can do this for you :)
http://weblogs.asp.net/cweyer/archiv...30/222725.aspx

--
Tomas Restrepo
to****@mvps.org
Nov 21 '05 #10

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

Similar topics

2
2571
by: Erik Klein | last post by:
I have a WebService whose WSDL contains the following snippet: <complexType abstract="true" name="Type"> <sequence> <element name="localId" nillable="true" type="xsd:string"/> <element name="id" minOccurs="0" maxOccurs="1" nillable="true" type="xsd:int"/> </sequence> </complexType>
2
6891
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In this example, the MessageID element should always occur (minOccur=1, maxOccur=1), but the WSDL generates minOccur=0. I can't pinpoint why this is happening and I can't find a may to force this in the code either. Anyone have any insight? This...
3
8884
by: Benne Smith | last post by:
hi all, i have a webservice with some public classes in it. These classes are visible from my proxy class, generated from wsdl.exe. The problem is, that when i look in the generated proxy class, my classes are reduced to properties only (like "public string myString;"). But the code, functions, are not transferred into the proxy class, which means i have to copy/paste the code, everytime i update the proxy class (again, using wsdl.exe)....
0
1972
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project by serveraddresss?wsdl, it gives me following error: Custom tool error: Unable to import WebService/Schema. Unable to import binding 'MyRemoteObjectBinding' from namespace...
0
4825
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project, it gives me following error: Custom tool error: Unable to import WebService/Schema. Unable to import binding 'MyRemoteObjectBinding' from namespace 'http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull'. Unable to import...
0
1984
by: bbalet.free.fr | last post by:
The “Add Web Reference” Visual tool generates bad classes (from WSDL schema) for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools have the same problem) : if a ComplexType A contains only one element, the tool don’t generate a class for the ComplexType A. It generates a class only for the element type (B) included in this ComplexType (if this type contains more than one element...). For types in WSDL schéma...
3
1491
by: Francisco Garcia | last post by:
Hi! I have developed both a Web Service and a client application, and they work fine. All classes used in the Web Service interface are declared in an assembly named Entities, that is referenced both in the Web Service and the client application. The problem is that the automatically-generated Web Service proxy class
3
5391
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate proxy classes (using WSDL) which consume more hard disk space & resources? For e.g. consider the following code which exists in a user-defined class file: Imports System Imports System.Data
0
1473
by: shreya | last post by:
Hi, I am new to wsdl.I am using weblogic server to generate a wsdl. I am writting my own inner abstract classes using schemas and then generating a wsdl file.In my schema I have a value as simpleContent . My output in test browser is <param><name></name></param> since the inner class i wrote as public static class queryParameters implements java.io.Serializable
0
7959
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
7883
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,...
1
8021
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
5842
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
5421
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
3876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2393
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
0
1226
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.