Situation:
I am attempting to set up a web service that will take in a "JobNumber" in the web service request, then query a database for shipping information which is then returned through the web service as a response. I've followed your "How to Publish a Process Flow as a Web Service" and "Using Web Service Publisher" documents and would like to know how to incorporate the database query into this process flow. Are there additional steps to the flow for the query?
Solution:
This can be achieved by firstly creating a Process flow which will be published as a web service provider.
Create a process flow which will query the database for the requested data.
Follow the below high level steps for creating the Process flow :
1) Create a new Database schema activity, put the context variable in the where clause of query.
For Example: Select * from Table where JobNumber = $$jobnumber$$
2) Create a new Database source activity, and use the Database schema activity created above. For more details of how to create Database source please refer to the development guide.
3) The ‘jobnumber’ is a context variable which will be set by the web service request.
4) Create a context source Activity with the same parameter name as the input variable name of your WS provider.
5) Create a Data Mapping activity and load the input XML schema of your provider at the source. The target schema will be a context target having a context variable named job number.
6) Map the “Job number” field of the source schema to the “Job number” field of context schema and save it.
7) Connect the activities in above path - ContextSource > DataMapping > DatabaseSource > ContextTarget(with same parameter name as the output variable name of WS provider).
9) Save the Process Flow created above.
10) Now attach the above process flow in your WS provider activity.
2 Comments