|
|
This is a simple example of how to develop and use a VB.NET webservice. This is going to be done
via a walkthrough. Once you have selected ASP.NET Webservice icon to create a new project. You
will need to enter a new name for the project and also the location of where the development
webservice will be placed. You will be asked how the communication between developer and server
will take place. My preference will be via Frontpage Extensions. If you prefer to use the option
then if you can get it to work feel free.
Once your project has been set up in the editor. You will need to change the name of your service
class "Service1.asmx" to whatever your class will be called. This is the name of the class
that you will instantiate on the client side.
Develop the webservice class as you would a normal VB.NET class. All functions that are going
to be accessible from the client, the function declaration must be prefixed with <Webmethod()>
Once the class has been developed and completed, compile by pressing F5.
Open a new VB.NET Devstudio if necessary and select the icon to create a VB Windows Application. Add a Webreference
to the application. The path to the webservice is "http://<server>/<Service>/<Class>.asmx.
Now all you need to do is declare an object with the webservice class and use it as you would a normal
class.
You can use the webservice to query and return a set of records. ADO.NET dataset can export datasets
as XML so you pass the recordset back as string.
Make a comment*Comments are the views of individuals, they may or may not be correct. All comments are reviewed and accepted or rejected. If you give an email address, you will be sent an email when someone makes a comment on this page.* | Only name and Code is compulsory. |
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
|