cancel
Showing results for 
Search instead for 
Did you mean: 

MessageSplit from JDBC-Sender to JMS-Receiver

Former Member
0 Kudos

Dear all,

we are getting data in a resultset from JDBC-Sender and have to process each row as a own message. When we use message-splitting we are not able to generate plainText for the receiving JMS-channel. So we thought that we first have to generate xml and afterwards in JMS-Receiver-Adapter we have to use MessageTransformBean Struct2XML, but it does not work.

Howcan we achieve this?

Here is our mapping:

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text" encoding="utf-8" />

<xsl:template match="//resultset">

<xsl:text disable-output-escaping="yes">&lt;ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"></xsl:text>

<xsl:text disable-output-escaping="yes">&lt;ns0:Message1></xsl:text>

<xsl:for-each select="row">

<xsl:value-of select="NODENAME" />

</xsl:for-each>

<xsl:text disable-output-escaping="yes">&lt;/ns0:Message1></xsl:text>

<xsl:text disable-output-escaping="yes">&lt;/ns0:Messages></xsl:text>

</xsl:template>

</xsl:stylesheet>

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

solved by ourselves

Former Member
0 Kudos

Hi,

>> How can we achieve this?

If I am not wrong you can acheive it by using Enhance Interface Determaination i, e Multi-Mapping without BPM.

Refer: /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Cross check you FCC content conversion at JMS reciver side.

Refer : http://wiki.sdn.sap.com/wiki/display/XI/HowTo...ContentconversionmodulewithJ2EEJMS+adapter

What error you are getting now?

Regards,

Abid

Former Member
0 Kudos

Hi Abid,

we've tried it with MessageTransformBean, but unfortunately we were'nt able to generate the correct messages for JMS.

If we adapt our original mapping to that one below than we are able to send 2 messages to JMS having the xml-structure. Now, we just have to remove the xml structure. How do we have to configure the Module-Tab? Which one's are the exact parameters we have to use?

new MAPPING:

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" encoding="utf-8" />

<xsl:template match="//resultset">

<xsl:text disable-output-escaping="yes">&lt;ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"></xsl:text>

<xsl:text disable-output-escaping="yes">&lt;ns0:Message1></xsl:text>

<xsl:for-each select="row">

<MSG>

<xsl:value-of select="NODENAME" />

</MSG>

</xsl:for-each>

<xsl:text disable-output-escaping="yes">&lt;/ns0:Message1></xsl:text>

<xsl:text disable-output-escaping="yes">&lt;/ns0:Messages></xsl:text>

</xsl:template>

</xsl:stylesheet>

resulting messages:

<?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_1</MSG>

<?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_2</MSG>

Kind regards, Stefan

Former Member
0 Kudos

Hi all,

if we configure the MessageTransformBean like this:

XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion

XML2Plain Transform.ContentType text/plain;charset=utf-8

XML2Plain xml.conversionType SimpleXML2Plain

XML2Plain xml.addHeaderLine 0

XML2Plain xml.fieldFixedLengths 5

XML2Plain xml.fixedLengthTooShortHandling Cut

he result of this conversion are two zero byte messages in JMS-Receiver! What is wrong with these parameters?

Kind regards, Stefan

Former Member
0 Kudos

Hi all,

with Bean-Configuration like this:

Transform.Class com.sap.aii.messaging.adapter.Conversion

Transform.ContentType text/plain;charset=utf-8

xml.conversionType StructXML2Plain

xml.addHeaderLine 0

xml.recordsetStructure MSG

xml.MSG.fieldFixedLengths 5

xml.MSG.fixedLengthTooShortHandling Cut

we get the following error:

com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'

Do we have to use a different recordsetStructure-parameter?

Kind regards, Stefan

Former Member
0 Kudos

Dear Stefan,

Did you add Module Sequence parameter in the JJMS receiver comm channel ?

1 localejbs/AF_Modules/MessageTransformBean L XML2Plain

2 localejbs/SAP XI JMS Adapter/ConvertMessageToBinary L CallJMSService

3 localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService L Exit

In addition, make sure that you do not enter any spaces after parameter names or values in your configuration, especially after copying values to the configuration from text files. pls cross check again

Pls refer: http://wiki.sdn.sap.com/wiki/display/XI/HowTo...ContentconversionmodulewithJ2EEJMS+adapter

Regards,

Abid

Former Member
0 Kudos

Hi Stefan,

*XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion

XML2Plain Transform.ContentType text/plain;charset=utf-8

XML2Plain xml.conversionType SimpleXML2Plain

XML2Plain xml.addHeaderLine 0

XML2Plain xml.fieldFixedLengths 5

XML2Plain xml.fixedLengthTooShortHandling Cut*

This is the correct configuration. Can you please check if the output of the mapping is producing the XML you want with 1 row and not just an empty XML declartion? I fear that is the case. Check SXMB_MONI payload after the Mapping pipeline step.

Regarding the XSL, I am not very good with XSLT. Cant help you much out there.

Regards

Jai

Former Member
0 Kudos

Hi Jai,

the result after mapping looks fine:

<?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_1</MSG>

In JMS they are zero bytes messages. What could we do?

Kind regards, Stefan

stefan_grube
Active Contributor
0 Kudos

> the result after mapping looks fine:

>

> <?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_1</MSG>

No this does not look fine

The target structure should have the same hierarchy level as the source.

Why you do not use graphical mapping instead of XSLT?

Former Member
0 Kudos

Hi Stefan,

>>So we thought that we first have to generate xml and afterwards in JMS-Receiver-Adapter we have to use MessageTransformBean Struct2XML, but it does not work.

Just a couple of points.

What do you mean by first generate XML? When the JDBC adapter retrieves data from the db and sends it to PI, it is already in XML format. Do you just mean splitting the XML into multiple messages? If so, then your logic is just fine including the Message Transformation Bean to convert the XML to plain text.

>>but it does not work.

If you can let us know where you are getting an error, we could help you better.

Regards

Jai

Former Member
0 Kudos

Hi Jai,

if we use the mapping I mentioned above we get the error message "Split mapping created no messages" without using the MessageTransformBean (even when we use xsl:output method="xml" in mapping).

So, starting from that point, what do we have to do?

I will post an example of a source message below:

<?xml version="1.0" encoding="utf-8" ?>

<resultset>

<row>

<NODENAME>VALUE_1</NODENAME>

</row>

<row>

<NODENAME>VALUE_2</NODENAME>

</row>

</resultset>

Kind regards, Stefan

rajasekhar_reddy14
Active Contributor
0 Kudos

First identify ypur xsl mapping giving perfect input in text format.

i advice implement mapping logic using Message Mapping, the use content conversion in JMS receiver channel.

What is the error r u getitng while implementing content converion in JMS CC??

Regards,

Raj