Translator is the new component introduced in SOA 12c which is very useful to convert any native format file like CSV to XML and vice versa.
Now am going to create a new application and BPEL process for doing this in JDeveloper 12.1.3
1) Create a new SOA Application named ‘TranslateApplication‘ and a project named ‘TranslateProj‘
2) Select Composite with BPEL Process and click on Finish
3) Name the BPEL Process as ‘TranslateBPELProcess‘ and Template as ‘Synchronous BPEL Process’ and click on OK
4) Drag and drop the Translate Activity which is under Oracle Extensions to the BPEL Process and double click on it.
5) Click on the Search icon and for Input and assign the client:input variable to it
6) For NXSD Schema field Click on the ‘New xsd icon’ and Select file type as Delimited and click on Next.
7) In the next screen browse the File and click on Next.
8) Select File contains only one record and Next. In next screen Enter the name for element as ‘Emp’
9) Check the Use First Record as the Field Name and click on Next and Finish.
10) Create an Output variable for assigning to reply Output and click on OK.
11) Now open the created Schema and remove the few xsd:schema attributes which are not required (nxsd:hasHeader, nxsd:HeaderLines , nxsd:headerLinesTerminatedBy) and save it.
12) Deploy the Project to server
13) Give the value for input as ‘Ravi, 15, 1000’ and click on Test Web Service and then click on ‘Launch Flow Trace’
14) Click on Input and Translate to see the comma seperated input and XML output.
15) If you are not able to see the Translate value in XML format then click on the deployed project and under settings change the Composite Audit Level to Development and test again. You can see the response in XML Format.