Translate Native Format File to XML File and Vice versa using Translator in SOA 12c

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

Snap1

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

Snap2

4) Drag and drop the Translate Activity which is under Oracle Extensions to the BPEL Process and double click on it.

Snap3

5) Click on the Search icon and for Input and assign the client:input variable to it

Snap4

6) For NXSD Schema field Click on the ‘New xsd icon’ and Select file type as Delimited and click on Next.

Snap5

7) In the next screen browse the File and click on Next.

Snap7

8) Select File contains only one record and Next. In next screen Enter the name for element as ‘Emp’

Snap8

9) Check the Use First Record as the Field Name and click on Next and Finish.

Snap9

10) Create an Output variable for assigning to reply Output and click on OK.

Snap10

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.

Snap11

12) Deploy the Project to server

Snap12

13)  Give the value for input as ‘Ravi, 15, 1000’ and click on Test Web Service and then click on ‘Launch Flow Trace’

Snap15

14) Click on Input and Translate to see the comma seperated input and XML output.

Snap16

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.

Snap18