Testing Your Web Service

Before you create a client for your web service, you can have Visual Studio 2005 create a test page for you. Just run the program in the debugger, as shown in Figure 14-2.

Testing the web services

Figure 14-2. Testing the web services

Click on GetName, for example. You will be prompted to enter a stock symbol, as shown in Figure 14-3.

Testing GetName

Figure 14-3. Testing GetName

Enter a valid stock symbol (one of the symbols in the array) and the stock's name is returned in an HTML document, as shown in Figure 14-4.

Value returned as XML

Figure 14-4. Value returned as XML

Examining the WSDL

You can examine the WSDL (Web Service Description Language) document for this web service by adding ?WSDL after the URL, as shown in Figure 14-5.

There are three things to notice in Figure 14-5. First, the URL is identical to the URL that brought up the test document, except that the string ?WSDL is appended. Second, both the GetValueStockInPorffolio and GetValueThisManyShares methods are shown (the names used in the MessageName property), but the GetValue method does not appear. The SOAP document (and thus the WSDL document) does not use the class's method name, but rather uses the unambiguous MessageName property.

Get Programming Visual Basic 2005 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.