Re: Inheriting Consumed WebService Class



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
>


.



Relevant Pages

  • Re: Inheriting Consumed WebService Class
    ... The first thing to remember is that your proxy class (i.e. what you've ... your web reference, your proxy class is generated from the WSDL's XML ... and sending it across the wire back you client. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: passing custom classes or stucture as arguments
    ... As soon as you reference the web ... The WSDL tool is used to generate a proxy class. ... Considerations for Custom Web Service Client Proxy Classes here ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Searching OO Associations with RDBMS Persistence Models
    ... and the Client needs access to locations for a particular Company. ... In this case I would argue that it should be a reference. ... There are three aspects to relationships: implementation, instantiation, and navigation. ... This sort of instantiation is ubiquitous in OO applications so that one very rarely ever sees a FIND WHERE construct. ...
    (comp.object)
  • Re: VS2008 creates a 2nd endpoint when actualising a web reference
    ... you are developing an WCF service and a client through VS 2008. ... The service used to use wshttpbinding, and when you switch it to netTcpBinding and regenerate the service reference at client, you found the client generate two configuration section for the service endpoint, correct? ... We welcome your comments and suggestions about how we can improve the support we provide to you. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: how to export view to display - xml with specific xsd?
    ... Also xp_cmdshell runs on the server, ... SQL Server to a file and open the file in Word on the client machine. ... It opens up a ... XML to be generated in a Word-specific XML format. ...
    (microsoft.public.sqlserver.xml)