cancel
Showing results for 
Search instead for 
Did you mean: 

Known conversion issue about PI multi mappings + Java?

Former Member
0 Kudos

Hi all,

i need some help / information for a 1:n RFC to SOAP scenario in Netweaver PI 7.11 SP 09.

Out of the RFC, multiple documents are created by using graphical mapping. Afterwards these documents are converted to string, by java mapping, and written to a new xml document. But somehow the java mapping produces different results in ESR test and full message process test.

As you can see, both 'Message' nodes contain an encoded XML string. But if i send a testmessage to pi, the following happens.

2 documents are created, as expected.

First document contains the xml string as expected.

Second document contains the xml string but somehow it was encoded twice??

Why does it happen?

I need to add, that i changed the java mapping multiple times to avoid this issue. My first attempt was to encode the strings, write them to a container xml and read the lines form the container xml to my target xml file. In OM test everything worked good, but PI test showed the issue above. Therefore i decided to remove the 2nd mapping step and created the target document within java mapping directly, also both nodes are created within one java mapping step.

Still, the first document is created correct, but the second is messed up by a second conversion of already converted special chars.

So i removed the loop in my java mapping, as it looks like the mapping is processed multiple times. As a result, only the first document was created (as expected), so the java mapping is not repeated.

Why is my second document, created out of the same java mapping, treaten different by PI than the first one? Why is any kind of conversion applied to this document after all?

Any help is appreciated.

PS: I can add the java coding / other screenshots if needed.

Accepted Solutions (0)

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Christian,

                    What is the input to the java mapping? It seems the first screen shot serves as input to the java mapping. When you read the contents of the field "message" within java mapping then before you read it ensure the string where you read the content is set to empty string or null.

Code snippet is shown below

loop

{

---------------------------

     String m="";

     m=read contents of the field message;

     m=m.replaceAll("&lt;","<");

     m=m.replaceAll("&gt;",">");

     ----------------------------------------

     ------------------------------------------

(you can add lines as per this link)

Write m to target XML

---------

}

To comment further on the issue , need to go thorugh the java mapping code you wrote.

Regards

Anupam

stefan_grube
Active Contributor
0 Kudos

Make sure that all internal classes and variables are cleared in the beginning of your Java code.

I have the impression, that the second Java program works on the result of the first mapping.

It is a common behaviour that Java programs running as EJB (like mapping programs) reuse all variables of the previous run.

Former Member
0 Kudos

Hello,

Do you put something in dynamic configuration (on graphical or java mapping) ?

It could be the reason why you programs running 2 times ?

What happen if you have 3 messages ?

Regards,

Guislain

Former Member
0 Kudos

Hi Stefan,

the variables are declared at the beginning of the code (2 of them are defined locally in a try catch block / while loop, as i do not need them later). The graphical mapping + java mapping works perfect in the ESR test of operational mapping. So both mapping steps are done and the mapping result contains my XML strings.

On the other hand, i'm not sure how the operational mapping is done for a 1:N mapping. In ESR the first step is done and afterwards the second step. Is it possible that each message will be processed separate in a full scenario?

I also wonder why the quotation marks of the included namespace are excaped in the second file (" -> "&quot;". Thats not needed at all and also not done by the normal java transformation.

PS: Am i not allowed to copy code in here?