Tuesday, 2 February 2016

NXSD Tester :- Test your files against NXSD neither deploying the SOA code nor JDeveloper(Command line tool)


Hello Folks,

Here is the exciting command line tool to test the FTP/File adapter NXSD to test the files.
In any middleware tool,
 If you want to test your nXSD(Native schema ) wrt files, you have only two options.

      1. Deploy the code to Server and put the Input testing files to file pickup location and run the code.
            2. Use JDeveloper to test the file wrt the nXSD.

Here I found another option to test the files against nXSD(Native schema). (Source: Oracle).
I have used the some libraries to test the NXSD. Here you see all the mandatory JAR to be used in below tool.

List of JARs.
      1. bpm-infra.jar
      2. mail.jar
      3. test-translator.jar
      4. translator.jar
      5. xml.jar
      6. xmlparserv2.jar

You can find all the JARs in weblogic folder post instillation.

Step by Step procedure:

Prerequisites:
     1. Have the java installed.
      2. Set the list of jars added to the class path.
      3. Run  java xlator.util.Translate –help to check the dependency . You should be able to run the command.

Procedure:
    1. Add the mandatory JAR files to one folder.
    2. Place the NXSD and Input file on the same folder to test.
    3. Open CMD in that folder path.
    4.  Run the below commands to test the files. (Note: You need to set the classpath before run these commands otherwise you will not be able to run)

Command 1: java xlator.util.Translate -inbound -schema (NXSD_Schema.xsd) -root (Root-Element Name) -input (InputFile.txt) -output (FileName.xml) 
You will get the tested output XML file if the Input files follow the schema.

Command 2: Run this command to test the file with de-batching as series of output files.
java xlator.util.Translate -inbound -debatch 1 -schema (NXSD_Schema.xsd) -root (Root-Element Name) -input address-csv.txt -output (FileName.xml)
You will get the series of tested output XML files if the Input files follow the schema & if you have the multiple records in the Input file.



Happy learning….!!!!!!!! Fun Sharing….!!!!!!!!!!!!!!!

Ram.

No comments:

Post a Comment