Step 4 Create a new SOAP Operation

LANSA Integrator

Step 4. Create a new SOAP Operation

INT010A - SOAP Service - Define Server

In this step you will create the SOAP Operation for your web service, GetEmployees, and define its Inbound and Outbound parameters.

Remember that GetEmployees will receive parameters that specify a department code and section code and will return a list or array of details for all the employees in that department and section.

1.  Select the Operations tab of the SOAP Wizard.

2.  Right click in the Operations panel to open the context menu.

3.  Select New Operation from the context menu.

4.  In the resulting dialog, enter the Operation Name, getEmployees and click OK.

5.  Now you will define the Inbound parameters. To do so:

a.  Right click on the getEmployees Operation to open the context menu.

b.  Select New Parameter from the context menu.

c.  Select the type for the parameter, in this case, a String.

6.  In the resulting dialog, enter the Parameter name, in this case departmentCode and click OK.

7.  Now repeat the same sequence for the remaining inbound parameter sectionCode, which is also a String and click OK.

8.  Define the return or Outbound parameter. This follows a similar procedure to the Inbound parameters.

a.  Right click on GetEmployees to open the context menu.

b.  Select Set Return Parameter from the context menu and select Server Types... from the sub menu.

     Server Types is selected because your return parameter is going to be the Server Type you created in Step 2. Define custom SOAP Server Types.

9.  In the Server Types dialog box, there are two entries for your Employee Server Type. The first one represents a single instance of Employee. The second one with [...] represents an array of Employees.

     Because you are returning an array of employees, select Employee [...] and click OK.

     You are returned to Operations tab of the SOAP Wizard where you can see the inbound and outbound parameters that you have defined. If you expand the entries in the Employee return parameter you will see the elements that make up the Employee server type.

     You have now defined your SOAP Operation and its parameters.

     When you define your own web services, you will probably define more than one SOAP Operation, but you will only create one for this tutorial.

10.Save your changes.