on 03-08-2007 10:09 AM
Hi all,
is it possible to dump the complete MainDocument to a CLOB field?
That is, starting from <?xml version=1.0> to the last closing tag?
I have thought of two possibilities here, but I am unsure how I can actually implement them:
1. Use a JDBC receiver to make an "INSERT INTO myTable myCLOB <MainDocument>".
2. Tell the message mapping to simply dump the whole source message that was passed to the Integration Engine into this CLOB field.
I am currently favoring option 2, but I have no idea yet how you can access the source message from inside the message mapping. I guess there is a system object that holds it... can you help me there?
Thanks and cheers!
Stefan
Stefan,
You cannot do this with Graphical Mapping.
You will need either Java or XSL mapping to handle this requirement.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan,
1. Use a JDBC receiver to make an "INSERT INTO myTable myCLOB <MainDocument>".
2. Tell the message mapping to simply dump the whole source message that was passed to the Integration Engine into this CLOB field.
you cant pass this "<MainDocument>" from Message mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the replies so far.
I have had a closer look at the JDBC receiver configuration, but I am still unsure to one matter: where do I build the insert statement?
I do not see a field for that in the JDBC receiver channel. What I have found in the how tos and blogs were message mappings that filled specific fields from specific input values. But I need to get the whole MainDocument into this single field.
Any ideas how to accomplish that?
Cheers!
Stefan
Stefan
1 . Receiver JDBC adapter expects data for the INSERT to be of a particular format.
<root>
<StatementName>
<dbTableName action= INSERT>
<table>realDbTableName</table>
<access>
<col1>xml payload from Source</col1>
</access>
</dbTableName>
</StatementName>
</root>
Write a java or XSL mapping that will create an output of this format where the entire XML paykload is copied between COL1 . You will have to rename the fieldnames according to your table strcuture.
Regards
Bhavesh
Go for XSLT, it's the easiest:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="http://www.outputservice.com">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/">
<out:OutputMessage>
<out:string>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
]]
>
]]>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:in="http://www.inputservice.com">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/in:InputMessage/in:string">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
Regards,
Henrique.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.