Step 2 Map Parameters to Program Variables

LANSA Integrator

Step 2. Map Parameters to Program Variables

INT010B - SOAP Service - Define Agent

In this step you will map the Outbound and Inbound parameters to the program variable names that you will use in the business logic that calls this web service.

The Inbound and Outbound parameters are obtained from the WSDL file you located in the previous step.

1.  Switch to the Operations tab of the SOAP Wizard.

     In the Operations tab, the left-hand panel shows the names of the web service operations that are defined in the WSDL file which you located in Step 1. Create a New Agent Solution.

2.  Tick ( P ) the box of the Operation that you wish to use. In this case it is getEmployees.

     Once ticked and selected, you will see the Inbound and Outbound parameters you defined in Step 4. Create a new SOAP Operation in INT010A.

3.  Map the Parameters(Outbound). These parameters are mapped in exactly the same way as used to map the parameters for EmployeeServer. That is:

a.  Select and right click the departmentCode to open the context menu.

b.  Select Field from the context menu. The Field Attributes dialog box is opened.

c.  In the Field Attributes dialog box, enter the corresponding program variable name, DEPTMENT and press OK.

4.  Repeat for the sectionCode Outbound parameter, mapping it to program variable SECTION.

     The mapped program variable name is now in brackets following the parameter name.

     The icon has changed to indicate that the parameter is mapped.

Tip: Instead of right clicking and selecting your action from the context menu, you can press Enter to open whichever parameter is highlighted. Use the Arrow keys to move up and down the list.

5.  Map the Return (Inbound) parameters. This parameter is a complex type and because of this, is handled slightly differently to the Outbound Parameters.

a.  Select and right click the Employee[...] to display the context menu.

b.  Select Fragment from the context menu. This option allows all the elements of Employee to be received in a single call.

c.  In the Fragment Attributes dialog, enter the name of the Fragment, in this case, it is RESPONSE.

d.  Press OK to confirm this assignment.

     Again you can see the mapped fragment name shown beside the Employee Return parameter, and that the icon has changed. In this case, the icon has changed for all the elements of employee because when you marked Employee as a Fragment, LANSA Integrator assumed that all the elements would be mapped to fields.

6.  You must now map each of the fields in the response.

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

b.  Select Edit from the context menu to open the Field Attributes dialog box.

c.  Enter the Name, in this case, EMPNO.

d.  Leave Format blank and Press OK.

7.  Map each Inbound field to the relevant program variable using these program variable names:

Inbound

Program variable name

firstName

GIVENAME

salary

SALARY

surname

SURNAME

 

 

     Note that the program variable used by the Agent program will not normally be the same as the name used for the server's program.

8.  When you have assigned all the Inbound fields, Save your work by either pressing the Save button, pressing the Ctrl + S keys or use Save from the File menu.