Beginner question: objects

J

Jeff Johnson

I would like to pass a generic System.Object to a web method. The actual
object will be of a derived class and will not always be the same class.
However, in my initial attempt I got errors saying "<specifc object type>
not expected." Are Web services unable to "ignore" the object type when
passing things around? If so, I may need to resort to Remoting instead
(assuming THAT will work).
 
J

Jeff Johnson

I would like to pass a generic System.Object to a web method. The actual
object will be of a derived class and will not always be the same class.
However, in my initial attempt I got errors saying "<specifc object type>
not expected." Are Web services unable to "ignore" the object type when
passing things around? If so, I may need to resort to Remoting instead
(assuming THAT will work).

Hmmm, it appears like I may be out of luck, because apparently at some point
in the serialization process the program (Web service or Remoting server)
needs to know about the concrete class that the object is based on and that
just isn't an option in my case. I've gone a different route, which is to
have the client serialize the object itself (I was hoping to avoid this) and
then simply pass the Web service a byte array. It's too bad there isn't an
Object.ToByteArray() method....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top