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
Brock Allen - 07 Aug 2005 00:36 GMT
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.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> 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
[quoted text clipped - 12 lines]
>
> thanks
Brad Roberts - 08 Aug 2005 18:22 GMT
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.
> 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
[quoted text clipped - 13 lines]
> thanks
>
RCS - 08 Aug 2005 18:57 GMT
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.
>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
[quoted text clipped - 26 lines]
>>
>> thanks