Writing a simple Web service
Here is a procedure to write a sample web service. Please go through the steps given below.
Step 1:
The screen shot below shows the creation of new web service.
In the Web Services Properties box, give the new Web service a name -- we use TestService for this example -- and close the box.
Now you should have a screen that looks very much like one used for writing a LotusScript agent. Click (Declarations) in the Objects tab of LotusScript events, so you can write a class (classes must always be defined in the (Declarations) section). Enter this code into the IDE:
|
- Creates a class called Test.
- Defines a method in the class called AlertMsg that accepts a string as a parameter and returns a string as a result (functions and subs in classes are referred to as methods).
Open the Web Service Properties box and specify which class to use. Because there may be multiple classes defined in the Web service code, you must select only one of them as an interface to the Web service. The interface class is the one with Public methods that Web service clients can call.
In the Properties box, enter Test (the name of the class you just wrote) in the PortType class field on the first tab.
The further details working with complex functions, testing of web service, we will discuss in next posts.