Web Service, the beginning

Web service in asp.net consists of a file with the .asmx extension, so you’ll have something like this
<%@ WebService language="VB" codebehind="Service1.asmx.vb" class="Service1" %>
Imports System.Web.Services
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()>_
Public Function HelloWorld(Byval name As String) As String
Return "Hello World " + name
End Function
End Class

To test this, browser http://localhost/WebService1/Service1.asmx and a simple interface with a list of methods show up.

Click on any one, and put in values for all parameters, click ‘Invoke’ to see the result, it’s not as hard as I thought it would be…

Advertisements