on 2016 Jan 28 3:17 PM
Hi team,
I am encountering an issue while running java mapping.My sccenarion is like below:
Third party webservice(Soap Adapter)->PI->Database server(JDBC stored procedure is being used).
in RWB ,I have found an error like 'Fatal parsing error'.while checking i have found that the error is coming on reponse mapping which is basically a java mapping followed by graphical mapping.
I have tested the response xml log and found the same error log in test tab of java mapping.
Please find att ached screenshpot and the response xml files below by which I have tested:
Step 1>Response mapping Tab:
Step 2:Running with the below response files in test tab:
Please find the code snippet from where the below error is faced this is a SAX parser code :
public void transform(TransformationInput in, TransformationOutput out)
throws StreamTransformationException {
setSAXParserFactory();
final String err = "Fatal parsing error.";
try {
// Prepare input, output and parser
Writer outputWriter = new BufferedWriter(new OutputStreamWriter(out
.getOutputPayload().getOutputStream(), charEncoding));
SAXEventHandler saxEventHandler = new SAXEventHandler(outputWriter);
SAXParser parser = parserFactory.newSAXParser();
// Parse XML
parser
.parse(in.getInputPayload().getInputStream(),
saxEventHandler);
outputWriter.close();
} catch (Exception e) {
e.printStackTrace();
getTrace().addDebugMessage(e.getMessage());
throw new StreamTransformationException(err, e);
}
}
need your advice whhy the error is coming .
Request clarification before answering.
xml looks to be good.
Try a test of your code in java only in netWeaver Developer Studio, then you can find the problem
use a main method, and local XML files.
//Implementation of the main method is for the stand alone testing of the mapping program
public static void main(String args[]) throws StreamTransformationException {
RemoveBodyTag object = new RemoveBodyTag();
try {
InputStream in = new FileInputStream(
new File(
"c:\\testMapping\\input.xml"));
OutputStream out = new FileOutputStream(
new File(
"c:\\testMapping\\output.xml"));
InputPayloadImpl payloadInObj = new InputPayloadImpl(in);
TransformationInputImpl transformInObj = new TransformationInputImpl(
payloadInObj);
OutPayloadImpl payloadOutObj = new OutPayloadImpl(out);
TransformationOutputImpl transformOutObj = new TransformationOutputImpl(
payloadOutObj);
object.transform(transformInObj, transformOutObj);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
refer to:
Parametrized Java Mapping in PI 7.1 - Process Integration - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ll try with above code .but just for your info I have run it in eclipse the same request file just excluding the second xml header part.
.
But here it is not giving any error instead of that it is generating an doc with the value from the input xml but there was no tag .only the value appears.
I donot know why it is coming
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.