De-batching inbound messages from BizTalk WCF SQL Adapter using TypedPolling has been meticulously explained by Richard here. Thought about doing something similar with the WCF Oracle Adapter and using the InboundOperationType as Polling. Following are the steps that I undertook to achieve this.
Note: if the auto-generated schema is not changed to envelope the send port created to pick response messages of WCF send receive port will create a single file containing all records.
- Use the consume adapter service to create the auto generated schemas for the select operation on a table in oracle. This step generates a schema and a binding file.
- Changed the schema to set the enevlope property to Yes.
|Fig1. Envelope schema|
- Added the Body XPath property on the SelectReponse node that is the response with the multiple rows to point to SelectResult, its child record. SelectResponse is the message retured by the WCF Oracle Select operation. Changed the max-occurs to 1 from unbounded for the child record of SelectResult. This will be the type of message generated after de-batching.
|Fig.2 Setting body XPath for Envelope schema|
- Sign this project and deploy the schema project.
- Create a receive port to get the trigger message for getting data from oracle table. Kept it simple at select * from table. This is the message of the auto-generated type Select.
Sample message :
|Fig. 3 Sample XML request for WCF Oracle Adapter.|
- Imported the binding file to create the request response port for the oracle adapter select from table operation. Create a filter on the WCF send receive port so that it picks the trigger message directly from the message box.
- Created a send port with a filter BTS.SPName = <<WCF Send Port Name>> to pick the response of WCF send port and drop into a file location.
- Ran the test with a trigger file. This resulted in the seperate debatched rows being created by the send port created in #7.
|Fig.5 Outbound folder containing de-batched rows.|