We have already created our OSB process and included the MFL.
Now we will create the business service based on the Person web service we deployed earlier.
Create the Business Service
All we need is the wsdl from the service we created earlier -
Consume the existing web service
Set Load Balancing Algorithm to none
We now have the following artifacts in our OSB project
Create the Proxy Service
In this scenario, our proxy service will read in the Cobol data from a directory
create this input directory along with ones for stage, error, archive.
So now you should have 4 directories -
On the General Tab --> Messaging Service
On the Messaging Tab -->
Transport Config --> File, specify input directory
File Transport -->
Implementing the Message processing logic
Essentially our business processing will involve checkimg what action is specified in the data coming from the Cobol based system.
Remember - PERSON-REQUEST-TYPE = "C" - Create etc.
If create then we call the "createPerson" operation of the Person Business Service.
But we need to amend the payload -
remember OSB is getting the full Cobol payload, all the business service requires is the last name.
So here are the steps we have to go thru -
1. check what action is required e.g. "C"
2. create a variable reflecting the parameter the action requires. e.g. create a variable based on the createPerson operation input data type.
3. Assign the last name from the payload to this variable
4. copy the variable to the OSB message body ($body is what will be passed to the business swervice).
5. call the relevant business service.
Create a Pipeline pair
Insert a log activity to output the incoming message
I set the level to ERROR so that I can see the message in the WLS console.
Add a Route Node
Add a Routing Table
Add case --> route based on request type
Specify target service
Specify "update" as the default operation for the Default route.
Now we can do the specific processing for the "create" route.
Create an XQuery mapping for OSB-input to create-person service input
Add an Assign Activity
Add a variable of type createPerson
Add a Log activity to output the newly created variable
After the Log add a Replace activity to replace the $body value with that of $createPerson
Add a Log activity to output the new value of $body
In the Response Pipeline -->
result from the business service