ASP.NET and Web Services Part 2
(Page 1 of 8 )
Today, Dwight takes us on a tour of the web services made available to us via ASP.NET. We learn about implementing interfaces, dynamic binding, class inheritance and interface inheritance. This piece comes from chapter seven of
.NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223-054-1, 2004).
Web Services Description Language
WSDL documents contain metadata about a client’s input and output parameters from an invocation externally. This means a user is invoking a method externally. In addition, the WSDL file describes the service’s functionality. In essence, the file facilitates interaction between disparate clients by providing the requisite information on how to achieve interoperability between them.
Let’s create a small web service in ASP.NET and then inspect the WSDL file. The first task required for building a web service in the .NET world is creating a virtual directory in Internet Information Services.
- Create a folder on the server, and name it “MySOAPExamples.”
- In Windows 2000 or Windows XP, select Start | Control Panel | Administrative Tools | Internet Information Services. Open IIS, right-click the default web site, select New, and then select Virtual Directory. A dialog box will appear on your screen. Select Next, and enter MySOAPExamples in the Alias dialog box. Make sure the subdirectory is already created somewhere on the hard drive.
Finally, proceed to Finish to generate the virtual directory. - Create a new project in Visual Studio .NET called “IFCEBrokerage.”
- Rename Webservice1.asmx to IFCEBrokerageFirm.asmx. The extension .asmx represents an ASP.NET web service extension.
- The namespace should be named “namespace IFCEBrokerage.”
- Enter the code shown in Listing 6.
Remember: This is part one of chapter 7 .NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223054-1, 2004). If you like what you see, feel free to click on the following link to get your own copy! Buy this book now.
|
Next: Web Service Code Sample >>
More ASP.NET Articles
More By McGraw-Hill/Osborne