Skip to Content
0
Former Member
Aug 11, 2005 at 04:03 PM

Rebuild a XML content inside a XI message

15 Views

Hello all,

we struck following point during our testing of "JDBC->RFC interface".

We have a JDBC adapter which reads records in certain database/table matching the condition. The SQL statement is e.g. like this:

select event, datetime, content from tracetab where status='X'

Understandably it fills a XI document let's say with "document name" = 'DBResultset_MSG' with proper tructure "<row><event /><datetime /><content /></row>.

So far so goot. The whole point is that the column CONTENT in the database record contains a "XML Document" ⚠️

So when the JDBC adapter sends the "MainDocument" into XI, it looks like this:

---------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<ns:DBResultset_MSG xmlns:ns="http://appg.com/CEZ_PP2SAP">
	<row>
		<EVENT>ZNM.export_row</EVENT>
		<DATETIME>20050729111500</DATETIME>
		<CONTENT>&lt;ZNM&gt;&lt;NESS_MRDTL_V rownum=&quot;1&quot;&gt;&lt;MATERIAL_REQUEST&gt;00201228&lt;/MATERIAL_REQUEST&gt;&lt;CATALOG_ID&gt;0000208130&lt;/CATALOG_ID&gt;&lt;Q_LEVEL&gt;0&lt;/Q_LEVEL&gt;&lt;NON_CATALOG_KEY&gt;         &lt;/NON_CATALOG_KEY&gt;&lt;FACILITY&gt;HS &lt;/FACILITY&gt;&lt;MOVEMENT_TYPE&gt;261&lt;/MOVEMENT_TYPE&gt;&lt;QTY_MTL_RQST&gt;1&lt;/QTY_MTL_RQST&gt;&lt;WORK_ORDER_NBR&gt;4000195&lt;/WORK_ORDER_NBR&gt;&lt;STORAGE&gt;CZ01&lt;/STORAGE&gt;&lt;/NESS_MRDTL_V&gt;&lt;NUM_OF_ROWS&gt;1&lt;/NUM_OF_ROWS&gt;&lt;/ZNM&gt;</CONTENT>
	</row>
</ns:DBResultset_MSG>
---------------------------------------------------------

As you can see, the JDBC adapter converts characters '<i><</i>' and '<i>></i>' ... which is probably ok, otherwise the XI message wouldn't make sence.

Our question is, which procedure would you suggest to "rebuild" the XML message to be mapped afterwards to RFC according to needs.

Our idea is to define same structure as the XML's structure into XI MessageType and remap the "demaged" content into it. The point is how ? We think that Java mapping is the only solution here.

What would you say ???

Thanks all in advance.

Regards Tomas