Consuming a Service Created with Web Matrix - Creating a web client in Web Matrix
(Page 4 of 5 )
Create a Web Service
Create a web service, three.asmx, as in Fig.12, which adds 3 numbers and returns the sum. Make sure you take note of the Namespace and Class that you provide here.
Fig.12
The code for this web service is as shown here in Fig.13:
Fig.13
You may test this service by running the program which produces the following, as in Fig.14:
Fig.14
In order to consume this service, you need to create a proxy. Web Matrix has a tool, which can be accessed from the Tools ->Web Services Proxy Generator. When you click on this you will be generating the dynamic link libraries to be associated with the client code. Fill in the appropriate information as shown here in Fig.15:
Fig.15
Click on the Generate button to generate the files. Make sure the output directory is the same as that in which the asmx file resides. The MyProxyClass.dll will be placed in the bin sub folder. With this preparation you are now in a position to create the client
Next: Creating the client page and testing >>
More Visual Basic.NET Articles
More By Jayaram Krishnaswamy