Skip to Content
0
Former Member
Sep 28, 2012 at 01:16 AM

XSLT to Multi-Mapping Visual Mapping in One Operation Mapping

121 Views

Hello,

I have a single operation mapping that has 2 steps:

1) XSL where an incoming XML message is converted into a more desirable format

2) Visual Message Mapping where the converted XML message it sent to a 3rd party system via HTTP. This is a 1:N multi-mapping scenario.

The message mapping used in step 2 has been setup with target as 0..unbounded. The Operation Mapping target has also been setup as 0..unbounded.

I've read many posts on SCN talking about the issue PI has with SplitAndMerge namespace and <messages> tags. In my XSL mapping I've tried both including the SplitAndMerge namespace like so:

<xsl:template match="/">

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

<ns0:Message1>

<ns1:MT_TransportationOrderRequest_Remapped xmlns:ns1="http://www.namespace.com/integration">

And exlcuding SplitAndMerge namespace like so:

<xsl:template match="/">

<ns1:MT_TransportationOrderRequest_Remapped xmlns:ns1="http://www.namspace.com/integration">

In both cases, the following Error is received during processing of the message in PI:

<SAP:P1>Split mapping created no messages</SAP:P1>

And the Trace shows:

<Trace level="3" type="T">Document start </Trace>

<Trace level="3" type="T">Start tag [ns0:Messages] </Trace>

<Trace level="3" type="T">Add raw attribute [ xmlns:ns0=&quot;http://sap.com/xi/XI/SplitAndMerge"] </Trace>

<Trace level="3" type="T">Start tag [ns0:Message1] </Trace>

<Trace level="3" type="T">Close tag [ns0:Message1] </Trace>

<Trace level="3" type="T">Close tag [ns0:Messages] </Trace>

<Trace level="3" type="T">Document end </Trace>

I have validated the XSL step is producing XML by removing the Visual Mapping piece all together from Operation Mapping and running a test message all the way to the 3rd party sender, which I can see in SXI_MONITOR with no errors in mapping/PI translation.

In case of using 2 steps detailed above in a single operation mapping, for some reason the results of XSL mapping (step 1) are not passed correctly to Visual Mapping (step 2) and Visual Mapping step is producing empty messages.

As expected, in scenario where SplitAndMerge is included in XSL I can successfully test the mapping working within Operation Mapping > Test. However, as multiple posts here pointed out that is just a shortcoming of PI and the SplitAndMerge needs to be removed even though it prevents testing in Operation Mapping > Test with all steps at once.

At this point it appears to me that XSL to multi-mapping visual mapping is simply not supported in PI, so I am seriously considering dropping the visual mapping step and just doing everything with XSL, but that kills half of the value of PI in this scenario and I wanted to see if anyone had better ideas.