Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Web Services QuickStart Tutorial

Proxy Type Sharing

ASP.NET Web Services now supports proxy type sharing. This feature allows you to share identical types from different Web services within the client-side proxy class. For example, you can take a type instance returned from one web service and pass it to another, and vice versa.

In this sample, a product invoice is returned from the Ordering Center. The user then wishes to update the ship date on the order. To do so, the user passes the same ProductInvoice instance to the Shipping Center, which updates the order and returns the modified product invoice.

How do you identify identical types? Identical types have the same type name and namespace, and also share the same schema type definition.

In this sample we indicate that types should be shared by putting the wsdl and discomap from each service in the 'App_WebReferences' directory. If you wish to use wsdl.exe instead to create your client proxy here is the command to share types between TypeSharingService1 and TypeSharingService2:

<!-- To share types, use the /sharetypes flag with wsdl.exe.  For example (all in one line): -->
     
wsdl.exe /sharetypes 
http://localhost/QuickstartV20/webservices/Samples/TypeSharing/cs/Server/TypeSharingService1.asmx
http://localhost/QuickstartV20/webservices/Samples/TypeSharing/cs/Server/TypeSharingService2.asmx


Run VB Sample
Run Sample View Source



Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2004 Microsoft Corporation. All rights reserved.