Scenario:
Http Client sends a Synchronous request to a DB. The stored Procedure is executed and the correspoing role of the user is sent back to the HTTP Client.List Of steps:
- Below is a sample DB Structure which is used in the scenario.
- sp_GetRole is the name of the Stored Procedure used.
Input parameters: Username, Password
Output parameters: Role
- Create the required Data types, Message Types & message interfaces required for Request Mapping. U can find the Stored Procedure Message Type on the Left hand side of request mapping shown below.
- Map the necessary fields.
EXECUTE-->action
true-->isInput
CHAR-->type (CHAR is the Data type of UName & UPassword). Refer to the DB structure in Fig 1.
- Create the required Data types, Message Types & message interfaces required for Response mapping. U can find the response of Stored Procedure Message Type on the Right hand side of response mapping shown below.
- Create the required Interface mapping
- Go to Configuration Time and create the necessary Configuration time Objects. Receiver Determination, Interface Determination & Mapping, Receiver Agreements.
- In JDBC Receiver Channel, key in the following parameter in connection textbox. jdbc:microsoft:sqlserver://<hostname>:1433;DatabaseName=<dbname>;SelectMethod=cursor
- Execute the Scenario by sending the request, and you will get the desired output.