cancel
Showing results for 
Search instead for 
Did you mean: 

N:1 Mapping Possible using Java Mapping?

bhavesh_kantilal
Active Contributor
0 Kudos

All,

Is it possible to do a N:1 mapping using Java Mapping?

If yes , how?

Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?

Regards,

Bhavesh

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi Bhavesh,

InputStream -> toString -> save file on server

BTW

I don't know but that's what I would do to check it:)

Regards,

michal

bhavesh_kantilal
Active Contributor
0 Kudos

Michal,

Exactly what I am trying..!!

Will update as soon as I am done.

Cheers,

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

<i>>>>>Will update as soon as I am done. </i>

you do that:)

Regards,

michal

former_member206604
Active Contributor
0 Kudos

<i>>>>>Will update as soon as I am done.</i>

Hmm sure waiting for the result.

I think should have Message tag or some equavalent coz XML can have only one root tag. So both the messgae types are at the same level so should be enclosed by a root tag.

Thanks,

Prakash

henrique_pinto
Active Contributor
0 Kudos

Bhavesh,

for multiple messages, XI's inputstream will be something like:

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<YOURXML1>...</YOURXML1>

</ns0:Message1>

<ns0:Message2>

<YOURXML2>...</YOURXML2>

</ns0:Message2>

<ns0:Messages>

So, your root tag will be Messages and inside each MessageX you will find your input messages (exactly like the source code for the source messages in Interface Mapping test tab).

This approach works for both Java and XSLT multimappings.

And it isn't just a guess, as I have already used it. 🐵

Regards,

Henrique.

bhavesh_kantilal
Active Contributor
0 Kudos

Henrique has it right

Just tried it out ( actually diverted the Input Stream to the Trace ) and the XML strcutre was as henrique has shown.

So, we would have to add the logic to separate each of the message inside our mapping code.

The strcuture given by henrique was just perfect

Regards,

Bhavesh

Former Member
0 Kudos

Hi @ll;

i try the same.

to conduct a java mapping with 2 input structures that fills one target structure.

This mapping is part of a Integrationprocess.

I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.

At runtime this structure looks like this (different prefix)

<?xml version="1.0" encoding="UTF-8"?>
<sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
	<sxi:Message1>
		<YOURXML1>...</YOURXML1>
	</sxi:Message1>
	<sxi:Message2>
		<YOURXML2>...</YOURXML2>
	</sxi:Message2>
</sxi:Messages>

As I put it in the Integrationprocess unfortunately a strange error arises.

The trace Workflow-Protocoll shows following error.

<Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
<Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
<Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>

I can't make head nor tail of it.

what´s the mistake?

can anybody please help me?

Thanks in advance

Kind regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Experts,

Need to check if i can get the javamapping for N:1 multimapping scenarios for any sample requirement having 2 or more input messages i.e ns0 and ns1 tags.

Regards

Deepak