Author |
Message
|
2swild |
Posted: Thu Dec 20, 2007 1:30 pm Post subject: XMLNSC CData Question |
|
|
Newbie
Joined: 30 Sep 2005 Posts: 7
|
I am unable to generate a CDATA field using XMLNSC, here's my line of code:
Set OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].INTEGRATION_XML.(XMLNSC.CDataField) = OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].REQUEST;
Here is my output XML:
<?xml version="1.0" encoding="UTF-8"?>
<RESPONSE>
<CONTROL>
<ORIGINATOR>AIS</ORIGINATOR>
<ORIGIN_DATETIME>20070202 14:07:02.707</ORIGIN_DATETIME>
<SERVICE>EAI_INTEGRATION</SERVICE>
<FUNCTION>DEFAULT</FUNCTION>
<DESTINATION>
<INSTANCE>DEF</INSTANCE>
<CLIENT>999</CLIENT>
</DESTINATION>
<VERSION>1.0</VERSION>
<PERSISTENCE>N</PERSISTENCE>
<REALTIME>Y</REALTIME>
<AUDIT_LOG>Y</AUDIT_LOG>
<ROUTER_MSGTIMES>
<GMTMSGSTART>2007-12-20 21:06:26.947968</GMTMSGSTART>
<GMTMSGCOMPLETION>2007-12-20 21:06:26.947968</GMTMSGCOMPLETION>
</ROUTER_MSGTIMES>
<BeginTime>2007-12-20 15:06:26.955558</BeginTime>
<DoneTime>2007-12-20 15:06:27.072854</DoneTime>
</CONTROL>
<RESULT>
<DATA>
<REQUEST_DETAIL>
<APP_ID>TERMSPAYROLL</APP_ID>
<INSTANCE>DV2</INSTANCE>
<CLIENT>120</CLIENT>
<INTEGRATION_ID>30</INTEGRATION_ID>
<INTEGRATION_STATUS>0</INTEGRATION_STATUS>
<INTEGRATION_XML>
<REQUEST>
<CONTROL>
<ORIGINATOR>Schroeder's App</ORIGINATOR>
<ORIGIN_DATETIME>Mon Apr 19 11:25:09 CDT 2007</ORIGIN_DATETIME>
<SERVICE>AIS</SERVICE>
<FUNCTION>AIS_BATCH_INTEGRATION</FUNCTION>
<DESTINATION>
<INSTANCE>DV2</INSTANCE>
<CLIENT>120</CLIENT>
</DESTINATION>
<VERSION>1.1</VERSION>
<PERSISTENCE>Y</PERSISTENCE>
<REALTIME>N</REALTIME>
<AUDIT_LOG>Y</AUDIT_LOG>
<ROUTER_MSGTIMES>
<GMTMSGSTART>2007-10-05 17:29:21.268084</GMTMSGSTART>
<GMTMSGCOMPLETION>2007-10-05 17:29:21.268084</GMTMSGCOMPLETION>
</ROUTER_MSGTIMES>
</CONTROL>
<APP>
<INTEGRATION>
<APP_ID>TERMSPAYROLL</APP_ID>
<INTEGRATION_ID>30</INTEGRATION_ID>
<ACTION>NEW</ACTION>
<LAST_RFC_XML_OCCURRANCE>1</LAST_RFC_XML_OCCURRANCE>
<LAST_RFC_CODE>0</LAST_RFC_CODE>
<LAST_RFC_DESCRIPTION>COMPLETED</LAST_RFC_DESCRIPTION>
</INTEGRATION>
<R3>
<Z_MSRV_TERMS_PAYROLL_PAYROLL>
<I_PERNR>1300053</I_PERNR>
<I_BEGDA>10042007</I_BEGDA>
<I_BETRG>1500</I_BETRG>
</Z_MSRV_TERMS_PAYROLL_PAYROLL>
<RFC_CODE>0</RFC_CODE>
<RFC_DESCRIPTION>COMPLETED</RFC_DESCRIPTION>
<RFC_RESULT>
<Z_MSRV_TERMS_PAYROLL_PAYROLL.Response>
<E_RET_VAL/>
<E_SUBRC>80</E_SUBRC>
<T_DSEG/>
<T_MSGS>
<item>
<CODE>E-175-PG</CODE>
<MESSAGE>No authorization to maintain Additional Payments (0015) exists</MESSAGE>
</item>
</T_MSGS>
</Z_MSRV_TERMS_PAYROLL_PAYROLL.Response>
</RFC_RESULT>
</R3>
</APP>
<STATUS>
<CODE>0</CODE>
<DESCRIPTION>SUCCESSFUL</DESCRIPTION>
</STATUS>
</REQUEST>
</INTEGRATION_XML>
<CREATED>2007-10-05 12:29:21</CREATED>
<UPDATED>2007-10-05 12:29:25</UPDATED>
</REQUEST_DETAIL>
</DATA>
</RESULT>
</RESPONSE>
Can anyone tell me what I'm doing wrong?
Thanks,
Lisa |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 20, 2007 1:35 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you intend to store the value of the REQUEST element, or the contents of all the children of the REQUEST element as a bitstream?
That is, are you sure that the code you wrote isn't doing exactly what you told it to do? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
2swild |
Posted: Thu Dec 20, 2007 1:40 pm Post subject: |
|
|
Newbie
Joined: 30 Sep 2005 Posts: 7
|
Thanks for quick reply!
I want to see a '<!CDATA[[' tag between my INTEGRATION_XML tag and the REQUEST tag.
Thanks,
Lisa |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 20, 2007 1:45 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The XML element <REQUEST> in your physical message is represented by an element in the logical tree.
The element in the logical tree doesn't have a "tag". In the case of this particular element, it also doesn't have a value. It's a node that is the root of a subtree, some of who's elements have values, and some of which don't.
The code you have written will assign the value of the logical element that represents the REQUEST element to the CDATASection.
As this value is NULL, you are not creating a CDATASection.
Please consider "ASBITSTREAM". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
2swild |
Posted: Fri Dec 21, 2007 9:41 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2005 Posts: 7
|
Jeff,
I really don't know what I'm doing, but I tried this based on your suggestion.
Set Environment.XMLString1.REQUEST = OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].REQUEST;
Set Environment.XMLString2 = cast(AsBitStream(Environment.XMLString1.REQUEST CCSID 1208) as BLOB CCSID 1208);
This is what the environment variables look like after it runs.
(0x01000000):XMLString1 = (
(0x01000000):REQUEST = (
(0x01000000):CONTROL = (
(0x03000000):ORIGINATOR = 'Schroeder's App'
(0x03000000):ORIGIN_DATETIME = 'Mon Apr 19 11:25:09 CDT 2007'
(0x03000000):SERVICE = 'AIS'
(0x03000000):FUNCTION = 'AIS_BATCH_INTEGRATION'
(0x01000000):DESTINATION = (
(0x03000000):INSTANCE = 'DV2'
(0x03000000):CLIENT = '120'
)
(0x03000000):VERSION = '1.1'
(0x03000000):PERSISTENCE = 'Y'
(0x03000000):REALTIME = 'N'
(0x03000000):AUDIT_LOG = 'Y'
(0x01000000):ROUTER_MSGTIMES = (
(0x03000000):GMTMSGSTART = '2007-10-05 17:29:21.268084'
(0x03000000):GMTMSGCOMPLETION = '2007-10-05 17:29:21.268084'
)
)
(0x01000000):APP = (
(0x01000000):INTEGRATION = (
(0x03000000):APP_ID = 'TERMSPAYROLL'
(0x03000000):INTEGRATION_ID = '30'
(0x03000000):ACTION = 'NEW'
(0x03000000):LAST_RFC_XML_OCCURRANCE = '1'
(0x03000000):LAST_RFC_CODE = '0'
(0x03000000):LAST_RFC_DESCRIPTION = 'COMPLETED'
)
(0x01000000):R3 = (
(0x01000000):Z_MSRV_TERMS_PAYROLL_PAYROLL = (
(0x03000000):I_PERNR = '1300053'
(0x03000000):I_BEGDA = '10042007'
(0x03000000):I_BETRG = '1500'
)
(0x03000000):RFC_CODE = '0'
(0x03000000):RFC_DESCRIPTION = 'COMPLETED'
(0x01000000):RFC_RESULT = (
(0x01000000):Z_MSRV_TERMS_PAYROLL_PAYROLL.Response = (
(0x01000000):E_RET_VAL =
(0x03000000):E_SUBRC = '80'
(0x01000000):T_DSEG =
(0x01000000):T_MSGS = (
(0x01000000):item = (
(0x03000000):CODE = 'E-175-PG'
(0x03000000):MESSAGE = 'No authorization to maintain Additiona
l Payments (0015) exists'
)
)
)
)
)
)
(0x01000000):STATUS = (
(0x03000000):CODE = '0'
(0x03000000):DESCRIPTION = 'SUCCESSFUL'
)
)
)
Output of AsBitStream.
(0x03000000):XMLString2 = X'')
Thanks,
Lisa |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 21, 2007 9:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't run ASBITSTREAM on Environment fields. Environment doesn't have a serializable parser.
Try
Code: |
Set Environment.XMLString2 = ASBitStream(OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].REQUEST); |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
2swild |
Posted: Fri Dec 21, 2007 10:00 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2005 Posts: 7
|
I had tried that too and it hurls on the no body found.
Dec 21 11:57:16 sw43 user:err|error WebSphere Broker v6003[2412704]: (BKDC1Q002.
_WOODRING)[4386]BIP2488E: (.EAI_INTEGRATION_REQUEST_Request.Main, 52.4) Error d
etected whilst executing the SQL statement 'SET Environment.XMLString2 = ASBITST
REAM(OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].REQUEST);'. : BKDC
1Q002.5b923a35-1601-0000-0080-e14b1b8213b4: /build/S600_P/src/DataFlowEngine/Imb
Rdl/ImbRdlStatementGroup.cpp: 589: SqlStatementGroup::execute: ComIbmComputeNode
: EAI_INTEGRATION_REQUEST#FCMComposite_1_2
Dec 21 11:57:16 sw43 user:err|error WebSphere Broker v6003[2412704]: (BKDC1Q002.
_WOODRING)[4386]BIP5010E: XML Writing Errors have occurred. : BKDC1Q002.5b923a35
-1601-0000-0080-e14b1b8213b4: /build/S600_P/src/MTI/MTIforBroker/GenXmlParser3/I
mbGenericXmlParser.cpp: 308: ImbGenericXmlParser::refreshBitStreamFromElements:
ComIbmComputeNode: EAI_INTEGRATION_REQUEST#FCMComposite_1_2
Dec 21 11:57:16 sw43 user:err|error WebSphere Broker v6003[2412704]: (BKDC1Q002.
_WOODRING)[4386]BIP5005E: No valid body of the document could be found. : BKDC1Q
002.5b923a35-1601-0000-0080-e14b1b8213b4: /build/S600_P/src/MTI/MTIforBroker/Gen
XmlParser3/ImbGenericXmlAsgardWriter.cpp: 721: ImbGenericXmlAsgardWriter::writeM
isc: : |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 21, 2007 10:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Right, because you're not starting at the XML Root node...
You need to use FolderBitStream or some other options...
I think if you search around for XMLNSC ASBITSTREAM you might find some workable code. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jan 02, 2008 2:53 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I want to see a '<!CDATA[[' tag between my INTEGRATION_XML tag and the REQUEST tag. |
Your syntax is incorrect. You should be setting the field type of INTEGRATION_XML to XMLNSC.CDataField, but your ESQL is creating an child node with no name, no value, and a field type of XMLNSC.CDataField.
Correct syntax would be ( not tested ):
Code: |
Set OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].(XMLNSC.CDataField)INTEGRATION_XML = OutputRoot.XMLNSC.RESPONSE.RESULT.DATA.REQUEST_DETAIL[i].REQUEST; |
Why are you copying REQUEST from OutputRoot. Do you want two copies of REQUEST in the output, or are you going to delete the original from OutputRoot before the XML gets written? |
|
Back to top |
|
 |
|