Page 210 - DCAP312_WEB_TECHNOLOGIES_II
P. 210
Web Technologies-II
Notes The WebService directive is similar to the Page directive that begins most .aspx pages. For
the Multiplication web service to work, you must assign values to two WebService directive
attributes: Language and Class.
The required Language attribute lets .NET know which programming language the class has been
written in. As you might guess, the acceptable values for the language attribute are currently
C#, VB, and JS for JScript.NET.
The Class attribute, also required, tells ASP.NET the name of the class to expose as a web
service. Because a web service application can comprise multiple classes, some of which may
not be web services, you must tell .NET which class to expose, a step analogous to declaring
a Main() method to indicate the entry point of a .NET console application or component.
Note that even if your web service contains only one class, setting this attribute is required.
Now back to our web service.
Step 3: Build Web Service and Run the Web Service for testing by pressing F5 function key.
Copy the URL of this web service for further use
Click on the Multiplications button to test the web service.
204 LOVELY PROFESSIONAL UNIVERSITY