Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > can webmethods be polymorphic?

Reply
Thread Tools

can webmethods be polymorphic?

 
 
Manco
Guest
Posts: n/a
 
      02-03-2005
Let's say I have a web-service that defines Web method:

void DoSomething(BaseType b);

let's day I have a DerivedType: BaseType. Can a web-service automatically
take a derived object base reference like a normal C# method would do? So
far I haven't been able to.


 
Reply With Quote
 
 
 
 
Lionel LASKE
Guest
Posts: n/a
 
      02-03-2005

My guess is yes.
You can use a DerivedType where a BaseType is expected.
It's just an XML problem. When .NET Framework serialize your DerivedType, it
take all fields and save them in XML. Fields from BaseType are saved then
fields from DerivedType are saved.
XML had been done to let updating of schema without impacting existing app.
So, when the .NET Framework deserialize your DerivedType as a BaseType, it
will take in the XML the fields needs for BaseType and ignore others (those
from DerivedType).


Lionel.


"Manco" <(E-Mail Removed)> a écrit dans le message de news:
9fgMd.1488$wc.414@trnddc07...
> Let's say I have a web-service that defines Web method:
>
> void DoSomething(BaseType b);
>
> let's day I have a DerivedType: BaseType. Can a web-service automatically
> take a derived object base reference like a normal C# method would do? So
> far I haven't been able to.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebMethods Info GMHK Java 0 06-10-2005 07:02 AM
US - TX -- WebMethods Analyst godwin Java 0 04-14-2005 11:40 PM
Can Webmethods be turned on/off within a SOAP Server depending on the situation? Jimmy ASP .Net Web Services 0 08-31-2004 01:11 PM
Posting Credentials using LWP To WebMethods mdh Perl 0 04-20-2004 01:27 AM
selectively exposing webmethods shovavnik ASP .Net Web Services 1 08-04-2003 01:20 PM



Advertisments