cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC to FILE scenatio: How to map the resultSet?

Former Member
0 Kudos

Hi,

I am doing the JDBC-XI-File integration scenario.

I am getting the data from the Database as the following XML:

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

- <resultset>

- <row>

<EMPNAME>Nagarjuna</EMPNAME>

<EMPID>100</EMPID>

<SALARY>15000</SALARY>

<DEPT>dev</DEPT>

</row>

- <row>

<EMPNAME>Mahendra</EMPNAME>

<EMPID>101</EMPID>

<SALARY>25000</SALARY>

<DEPT>dev</DEPT>

</row>

</resultset></b>

how to do the mapping?

I actually created a Data Type(JDBCSend_DT) & Message type & Message Interface for the Sender JDBC.

The mapping program I defined was not between <b>JDBCSend_MT</b> and <b>FileReceiver_MT</b>. (NOT BETWEEN resultSet and FileReceiver_MT)

Please help me to solve this.

Thanks in advance,

Nagarjuna.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

hi,

in the sender JDBC adap[ter, you have 2 fields called,

<b>Document Name

Document Namespace</b>

Give Document Name as <b>JDBCSend_MT</b> and DocumentNamespace as the namespace that you have created for your Datatype.

Regards,

bhavesh

Former Member
0 Kudos

Hi Bhavesh,

I changed the "Document Name" as you said.

But I am getting the following error in the SXI_MONITOR:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_JDBC_FILE_MM_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>

<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>During the application mapping com/sap/xi/tf/_JDBC_FILE_MM_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Can you tell me what is this error, and how to troubleshoot this?

Thanks,

Nagarjuna.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Can you copy the source payload from SXMb_MONI and use it to test your mapping?

regards,

bhavesh

Former Member
0 Kudos

Hi,

I am getting the following error when I tested.

<b>11:42:04 Start of test

Document start

Start tag [ns1:FileRecv_MT]

Add raw attribute [ xmlns:ns1="http://www.xxx.com/file"]

Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Root Cause: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3)(:main:, row=2, col=3) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2733) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2778) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:227) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:141) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:156) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:259) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) -


at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Caused by: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2733) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2778) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:227) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:141) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:156) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:259) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) ... 3 more Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 2d, 20, 3c(:main:, row:2, col:3)

11:42:04 End of test</b>

Thanks,

Nagarjuna.

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

Thanks for your help. I am able to run the integration scenario successfully.

The problem was I was giving wrong DocumentName in the CC. There was no problem with namespace.

Thanks again.

Regards,

Nagarjuna.

STALANKI
Active Contributor
0 Kudos

give the same name space in document name space..see if it solves.!

STALANKI
Active Contributor
0 Kudos

please map as I replied ..That should solve ur error!..make sure employee occurence is 0..unbounded and row occurent and map both of them

Former Member
0 Kudos

Hi,

I already made the EMPLOYEE(FileSend_DT) and row(Dataget_DT) as 1..Unbounded.

i feel the problem is at namespace, In the SXMB_MONI you can see the namespace as:

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

<<b>ns</b>:Dataget_DT xmlns:<b>ns</b>="http://www.xxx.com/xi">

But when I see te test xml ( not SXMB_MONI) the namespace is:

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

<<b>ns0</b>:Dataget_MT xmlns:<b>ns0</b>="http://www.xxx.com/xi">

Thanks,

Nagarjuna

Message was edited by: Maha Nagarjuna Angalakuditi

Message was edited by: Maha Nagarjuna Angalakuditi

bhavesh_kantilal
Active Contributor
0 Kudos

hi,

try using

Document Name ns0:Dataget_MT

Document Namespace ns0="http://www.xxx.com/xi

Let us know if it works,

Regards,

Bhavesh

STALANKI
Active Contributor
0 Kudos

CHECK THE OCCURENCE FOR EMPLOYEE NODE..IT Z 0..UNBOUNDED AND ALSO MAP THE ROW TO EMPLOYEE..

UR PARSER EXCEPTION MIGHT BE DUE TO CUT AND PASTE PROBLEM....

CHECK THE BLOG AND PASTE THE ERROR APPROPRIATELY SO THAT WE CAN HELP..

Former Member
0 Kudos

Some more info:

The payload from SXMB_MONI:

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

- <ns:Dataget_DT xmlns:ns="http://www.xxx.com/xi">

- <row>

<EMPNAME>Nagarjuna</EMPNAME>

<EMPID>100</EMPID>

<SALARY>15000</SALARY>

<DEPT>dev</DEPT>

</row>

</ns:Dataget_DT></b>

Message Mapping test (if I directly provide the emp details):

<b><?xml version="1.0" encoding="UTF-8"?>

<ns0:Dataget_MT xmlns:ns0="http://www.xxx.com/xi">

<row>

<EMPNAME>Nagarjuna</EMPNAME>

<EMPID>12321</EMPID>

<SALARY>213214321</SALARY>

<DEPT>dev</DEPT>

</row>

</ns0:Dataget_MT></b>

Regards,

Nagarjuna

Message was edited by: Maha Nagarjuna Angalakuditi

STALANKI
Active Contributor
0 Kudos

can u specify the target structure filerecv_mT.

Former Member
0 Kudos

The Target structure:

<b><?xml version="1.0" encoding="UTF-8"?>

<ns1:FileRecv_MT xmlns:ns1="http://www.xxx.com/file">

<EMPLOYEE>

<NAME>Nagarjuna</NAME>

<ID>12321</ID>

<SALARY>213214321</SALARY>

<DEPT>dev</DEPT>

</EMPLOYEE>

</ns1:FileRecv_MT></b>

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

When you are copying the source from the payload from SXMB_MONI ,and pasting it into the message mapping , you will find a few "-" symbol, you need to delete this

" - " and then test the mapping.

Just check if you have done this or not.

Also, cross check the Source Datatype with the Payload in SXMb_MONI. DO THEY MATCH?

Regards,

Bhavesh

Former Member
0 Kudos

After removeing the "-" the error;

<b>12:08:35 Start of test

Cannot produce target element /ns1:FileRecv_MT/EMPLOYEE. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element /ns1:FileRecv_MT/EMPLOYEE. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

12:08:36 End of test</b>

Regards,

Nagarjuna.

STALANKI
Active Contributor
0 Kudos

This error is due to message mapping..there might be some thing wrong in your mapping..

use this blog and check th proper error..try to fix if u can or paste the errror so that we can help..

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios