Invoking Web Services with Visual Basic .NET
The author provides a brief introduction to Web Servicessans the hypeand then shows you how to invoke a live Web Service
by Yasser Shohoud
A Web Service is an application that exposes a Web-accessible API. By exposing Web-accessible APIs, Web Services can enable new types of highly integrated software solutions. Today, the solutions you build usually contain components that encapsulate some functionality such as database access (ADO) and XML parsing (MSXML). Tomorrow, some of the solutions you build might invoke Web Services to gain access to content or perform a business function outside the boundaries of the server or server farm where your application runs.
Web Services come in many flavors. Some Web Services are used for integrating applications within an intranet, thereby bridging the gap between heterogeneous platforms and component models. Others are used to connect applications across the Internet. There are two categories of Internet Web Services: Content providers and service providers. Content providers give you programmatic access to content such as current weather conditions, maps, or news. Service providers usually integrate back-end data with business processes, giving you programmatic access to a business service such as reserving a rental car, submitting a purchase order, or processing a credit card. You can further classify service providers into Internet and extranet depending on whether they are open to the public or to a select few. For example, a company might expose an invoicing Web Service for vendors to submit invoices. Such a Web Service would be intended only for the company’s vendors and not for the Internet at large.
Invoke a Web Service
A good way to get started (and to get you hooked) is to call a live Web Service. You’ll find a few sites that list Web Services, including www.xmethods.com and www.vbws.com/services. If you’re looking for Web Services exposed by a particular company, you can usually find them by searching the UDDI registry. In fact, Visual Studio .NET makes it easy to do this.
To get started, fire up Visual Studio .NET and select New Project from the File menu. Click on Visual Basic Projects and select Windows Application. Type InvokingWS in the Name box.
Add a couple labels, a textbox, and a button to the default form. The result should look something like Figure 2. Note that the status label is called label2 and initially displays "Ready.
Back to top