8.3. Implementing Multiple Interfaces

The next logical step is to implement multiple interfaces on the same Web service. You do this by applying multiple WebServiceBinding attributes to the class implementing the Web service. On each Web method you set the SoapDocumentService or SoapRpcService Binding property to the name of the binding that contains this method. Taking the SupplierIface1 class in Listing 8.1, you might want to factor out its methods into two interfaces: IOrderMgmt and IQuoteMgmt. Listing 8.6 shows the code used to achieve this.

Listing 8.6. Defining multiple bindings (interfaces) (VBWSBook\Chapter8\Supplier2.asmx.vb)
 <WebServiceBinding( _ Name:="IOrderMgmt", _ [Namespace]:="http://LearnXmlWS.com/Supplier"), _ WebServiceBinding( ...

Get Real World XML Web Services: For VB and VB .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.