Testing the Web Service


Now, you can test the service. Opening the file Service1.asmx in the browser (you can start it from within Visual Studio 2005 by going to Debug Start Without Debugging) lists all methods of the service, as can be seen in Figure 20-9. In your service the only method is ReverseString().

image from book
Figure 20-9

When you choose the link to the ReverseString method, you see a dialog to test the Web service. The test dialog has edit fields for every parameter you can pass with this method; here it is only a single parameter.

In this page, you also get information about what the SOAP calls from the client and the responses from the server will look like (see Figure 20-10). The examples show SOAP and HTTP POST requests.

image from book
Figure 20-10

Pressing the Invoke button after entering the string Hello Web Services! into the text box, you receive the result from the server shown in Figure 20-11.

image from book
Figure 20-11

The result is of type string, and, as expected, it is the reverse of the entered string.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net