Академический Документы
Профессиональный Документы
Культура Документы
This article is from the excellent Blog by Niall Commiskey. See complete article here - http://niallcblogs.blogspot.com/2010/06/cobol-on-buscobol-copybooks-oracle.html
I'm back doing some work on Oracle OSB11g - preparing a POC showing integration with Cobol Copybooks.I actually began my IT life programming Cobol on Honeywell DPS8 for the Irish Revenue Commissioners so it was a bit deja vu for me. For those post-Cobol baby boomers here's an example of such a cobol copybook 000100 01 PERSON. 000200 05 PERSON-FIRST-NAME PIC X(10). 000300 05 PERSON-LAST-NAME PIC X(10). 000400 05 PERSON-COUNTRY PIC X(02). 000500 05 REQUEST-TYPE PIC X(01). save the above to a file with the extension .cpy e.g. person.cpy This is a very simple person definition - X --> alpha. In this scenario we receive a message that adheres to the definition in the Cobol Copybook.If it is of request type "C" (Create) we will route to the create operation of the Person business service.If it is of request type "U" (Update) we will route to the update operation of the Person business service.If it is of request type "D" (Delete) we will route to the delete operation of the Person business service. We will now implement what will be our OSB Business Service. Create Person Web Service In JDev simply create a Java class that implements 3 methods createPerson(String name) updatePerson(String name) deletePerson(String name)
Expose as a web service and deploy to the WLS instance running OSB.
Test the web service via the WLS console e.g. localhost:7021/console --> deployments --> test etc.
Double click on the newly created file to start Format Builder. Import Cobol Copybook...
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 -
e.g. http://localhost:7021/PersonProcessorWS-PersonProcessorWS-contextroot/PersonProcessorImplPort?WSDL
Click "OK"
Create the Proxy Service In this scenario, our proxy service will read in the Cobol data from a directory e.g. D:\WorkshopEnvs\OSB11g\demos\Cobol-In-Dir create this input directory along with ones for stage, error, archive. So now you should have 4 directories D:\WorkshopEnvs\OSB11g\demos\Cobol-In-Dir D:\WorkshopEnvs\OSB11g\demos\Cobol-Error-Dir D:\WorkshopEnvs\OSB11g\demos\Cobol-Stage-Dir D:\WorkshopEnvs\OSB11g\demos\Cobol-Archive-Dir
On the General Tab --> Messaging Service On the Messaging Tab -->
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. Steps Create a Pipeline pair
I set the level to ERROR so that I can see the message in the WLS console. Add a Route Node
Now we can do the specific processing for the "create" route. Create an XQuery mapping for OSB-input to create-person service input
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
Test
1 comments:
Raju said...
Thanks for the information shared here. that was an interesting and informative. I had a good experience by participating in the Cloud Computing and SOA Conference in 2009 which is most influential Business Technology Conference covering latest innovations and trends of Cloud Computing, SOA and its technologies. I learnt lot of new technologies in Cloud Computing. And I am planning to attend 2010 edition as well. I found the information about the conference from http://www.btsummit.com