cancel
Showing results for 
Search instead for 
Did you mean: 

Leading space in XML causing mapping error

Former Member
0 Kudos

Hi Experts,

I am tranfering data from JMS queue to BW using JMS and XI adapters respectively. The xml message that is coming from the JMS Queue has got a leading space. Therefore, in our PROD system one message threw a null pointer exception in the mapping program and blocked the queue. Everyday there are more messages coming and waiting in the queue to be processed.

Now, I can not delete the message that is throwing the error cause the subsequent messages has the leading space as well and they will throw the same error.

I also can not afford loosing data.

Anybody has any idea how to relosve this.

Award points for any clue.

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Is XI receiving XML message or plain message(doing plain to xml at adapter level) from JMS queue?

Thanks

Sai

Former Member
0 Kudos

Sai,

XI is receiving XML message from the queue. Not pain to XML at adapter level.

The followings are the settings for the JMS adapter

Transport Protocol - Access JMS Provider with JNDI

Message Protocol - JMS 1.x

Adapter Engine - Integration Server

Former Member
0 Kudos

Hi Sabbir,

Refer this Thread.

Hope it helps..

kumar.S

Former Member
0 Kudos

Dear Kumar,

Thanx for that. But my problem is different. I have a leading space one in one element but at the start of XML.

For example the following XML will work fine

<?xml version="1.0" encoding="ISO-8859-1" ?>

<GDE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="gde_V1_0.xsd">

<Ti tid="141.288261580" es="\WCWA.$WPEB:367499245" />

<Cols>

<Col n="COMPANY_CODE" t="string">W</Col>

<Col n="WORKS_ORDER_NUM" t="string">JA1271233</Col>

</Cols>

</GDE>

but the following will not work.

<b>LEADING SPACE</b><?xml version="1.0" encoding="ISO-8859-1" ?>

<GDE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="gde_V1_0.xsd">

<Ti tid="141.288261580" es="\WCWA.$WPEB:367499245" />

<Cols>

<Col n="COMPANY_CODE" t="string">W</Col>

<Col n="WORKS_ORDER_NUM" t="string">JA1271233</Col>

</Cols>

</GDE>

How can I trancate the leading space in the whole XML ?

Thank you.

Former Member
0 Kudos

I am not sure how you are getting leading spaces at the start of the xml document.

Is the source data already in the xml format with this space added or this space is being by the sender channel any idea

Regarding how to remove the leading spaces

you can use a simple java mapping to read the input stream and remove the leading space from the start of the xml document and then pass the output of this mapping to your normal msg/other mapping program in the same sequence.

basically XI allows you to call multiple mapping programs in a sequence provided the output structure of one is same as the input structure to the other.

Cheer's

Former Member
0 Kudos

Regarding the msg's already in the queue they can be handeled only by a mapping change as the incorrect XML is already been sent to integration server. if you make any changes in the JMS sender or the source system to remove this space it will not have any bearing on the already present incorrect msgs in the IS. these chnages will only impact the new msg's that will be processed by the sender channel.

Former Member
0 Kudos

dear Dreamcatcher,

This has been a very useful answer. Can you please give example code for writing such java mappings and how to pass the output to the normal message mapping.

Any useful 'How to Guide' or other doco will be of great help.

Thank you.