473,385 Members | 1,907 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,385 software developers and data experts.

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 3801
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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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**************@TK2MSFTNGP12.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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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.nospam> wrote in message
news:eu***************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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**************@TK2MSFTNGP09.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.nospam> wrote in message
news:eu***************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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.nospam> wrote in message
news:er**************@TK2MSFTNGP12.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**************@TK2MSFTNGP09.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.nospam> wrote in message
news:eu***************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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**************@TK2MSFTNGP09.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.nospam> wrote in message
news:eu***************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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.nospam> wrote in message
news:e2**************@TK2MSFTNGP09.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.Services.Protocols.SoapHttpClientProtoc ol
{}

/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespac e=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**********************************@microsof t.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**************@TK2MSFTNGP09.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.nospam> wrote in message
> news:eu***************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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.nospam> wrote in message
>>> news:e2**************@TK2MSFTNGP09.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.Services.Protocols.SoapHttpClientProtoc ol {}

/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespac e=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
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...
2
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...
3
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,...
0
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...
0
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...
0
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...
3
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...
3
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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,...

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.