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
tab of the SOAP Wizard.In the Step 1. Create a New Agent Solution.
tab, the left-hand panel shows the names of the web service operations that are defined in the WSDL file which you located in2. 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
and parameters you defined in Step 4. Create a new SOAP Operation in INT010A.
3. Map the
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
from the context menu. The dialog box is opened.
c. In the DEPTMENT and press .
dialog box, enter the corresponding program variable name,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
( 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
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 RESPONSE.
dialog, enter the name of the Fragment, in this case, it isd. Press
to confirm this assignment.
Again you can see the mapped fragment name shown beside the
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
to open the context menu.
b. Select
from the context menu to open the dialog box.
c. Enter the Name, in this case, EMPNO.
d. Leave
blank and Press7. 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
button, pressing the keys or use from the menu.