Re: Inheriting Consumed WebService Class
- From: "Paul W" <paul.whygle_NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 7 Nov 2005 19:56:15 -0800
Hey Peter,
This was actually incredibally helpful....however, some example code (as
simple as you feel would be helpful) would be greatly appreciated.
Thank you so much for your time and help!!!
Paul
"Peter Kelcey" <Peter.Kelcey@xxxxxxxxx> wrote in message
news:1131139664.320276.7600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Paul
>
> The first thing to remember is that your proxy class (i.e. what you've
> called the consumed webservice code-behind file) is generated from your
> service's WSDL and not directly from your C# class. When you create
> your web reference, your proxy class is generated from the WSDL's XML
> and is therefore limited to what is defined in that XML. If you look at
> the WSDL you will see that there is no reference to class properties,
> gets, sets etc.
>
> The second thing to remember is that when you make your web service
> call, you are not actually marshalling up actual instance of your class
> and sending it across the wire back you client. What you are doing is
> serializing your class into XML and sending that XML back to your
> client. What you are getting on the client side is an XML snapshot of
> your customer class as it exists at the time of service call. Because
> you are only getting a snapshot, you don't get any of the methods in
> the class or any else in the way of functionality. You are only able to
> access the properties in the class via the public variables.
>
> In order to have full access to class method, propeties etc, what I
> would recommend doing is creating your customer class in a separate
> project that you will reference from both your web service and your
> client application. By doing that, both projects will have full access
> to your class, its methods, its overridable properties etc.
>
> Next, create (in the client project) the new superclass that will
> inherit from your base customer class.
>
> Next, create the web reference from your client to your service. In
> your auto-generated proxy class, manually change any references to the
> base customer class (which will be defined further on in your proxy
> class) with a reference to the new superclass you just created.
>
> At that point, you will be able to retrieve a fully functionaly class
> from your proxy that will have your methods, properties etc in it.
>
> Hopefully that wasn't too confusing. If it was, let me know and I will
> post back some code examples from a sample project I have.
>
> Hope that helps,
>
> Peter Kelcey
>
.
- References:
- Inheriting Consumed WebService Class
- From: Paul Whygle
- Re: Inheriting Consumed WebService Class
- From: Peter Kelcey
- Inheriting Consumed WebService Class
- Prev by Date: Re: Static Constructor & webservice
- Next by Date: Serialization issues using .NET Framework 2.0?
- Previous by thread: Re: Inheriting Consumed WebService Class
- Next by thread: Umlauts from PERL script on FreeBSD dropped by C# web service
- Index(es):
Relevant Pages
|