Problem with a method, of an object, that a webmethod returns..

R

RCS

I have a web service. I have a method that returns an instance of another
class. I already learned the hard way that all properties of a returned
object have to be get AND set, even though I don't want the set. Now, when I
create a method in this secondary class, I don't see it on the consumer at
all. It's almost like, if I return an object from a WebMethod - I can't have
any methods. is that correct?

I've tried just about everything I can think of. I've set the [WebMethod]
attribute (even though this class isn't a web server, itself). I've tried
changing return types. I realized that I can't get any method, with any
return type to work in this scenario.

Is this an inside joke that I don't know about? Btw, the web service and
consumer app is 2.0 beta 2.

thanks
 
B

Brock Allen

WebServices aren't about passing objects -- they're about passing XML from
one platform to another. You must realize the class/object you're passing
back is a .NET representation of the XML data your returning to your consumer.
The point of web services to to enable this data integration without caring
what the other platform is. So, don't think about objects; instead think
about passing data.
 
B

Brad Roberts

I have a web service that returns an object that contains members that are
also objects. The client interface code that was created by the IDE did not
work. It sounds similar to your problem.

My solution made sense when I finally figured it out. The consuming(client)
code needed modifications in "New()" to include New() instances of the other
classes.
 
R

RCS

As I've been digging into this more and more, I've really hit some walls
with Web Services - because I was looking to pass objects back and forth.
I'm now working on a Remoting solution that is working out just fine.

It does definitely seem that the SOAP (SIMPLE object access protocol)
concept really is for simple heterogenous system communication, not for
complex communication.


Brad Roberts said:
I have a web service that returns an object that contains members that are
also objects. The client interface code that was created by the IDE did
not
work. It sounds similar to your problem.

My solution made sense when I finally figured it out. The
consuming(client)
code needed modifications in "New()" to include New() instances of the
other
classes.

RCS said:
I have a web service. I have a method that returns an instance of another
class. I already learned the hard way that all properties of a returned
object have to be get AND set, even though I don't want the set. Now,
when I
create a method in this secondary class, I don't see it on the consumer
at
all. It's almost like, if I return an object from a WebMethod - I can't
have
any methods. is that correct?

I've tried just about everything I can think of. I've set the [WebMethod]
attribute (even though this class isn't a web server, itself). I've tried
changing return types. I realized that I can't get any method, with any
return type to work in this scenario.

Is this an inside joke that I don't know about? Btw, the web service and
consumer app is 2.0 beta 2.

thanks
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top