Author |
Message
|
aaron_blade |
Posted: Thu Jan 21, 2010 9:17 pm Post subject: Assigning XML mesage to Character |
|
|
Apprentice
Joined: 21 Dec 2009 Posts: 29
|
Hi,
I want the below given part of XML to assign to a character varibale. How can I do that?
<rcmt:Topics xmlns:rcmt="http://www.sample.com/1.0/topics">
<rcmt:Document>Topic.Document.ORDERS05</rcmt:Document>
<rcmt:DocumentFormat> Topic.DocumentFormat.Version.1</rcmt:DocumentFormat>
<rcmt:Application>Topic.Application</rcmt:Application>
</rcmt:Topics>
I have given reference till rcmt:topics and then trying to assign this to a character variable.
Below is what I did..
DECLARE rcmt NAMESPACE 'http://www.sample.com/1.0/topics';
SET topics = CAST (ASBITSTREAM(topicRef.rcmt:Topics)AS CHAR ENCODING MQENC_NATIVE);
Here is the error message its throwing
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:ESB_CORE_FLOW#FCMComposite_1_2
Label:CHARACTER:ESB_CORE_FLOW.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbComputeNode.cpp
Line:INTEGER:464
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:ESB_CORE_FLOW#FCMComposite_1_4
Label:CHARACTER:ESB_CORE_FLOW.Process_Message
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:612
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:ESB_CORE_FLOW#FCMComposite_1_4
Label:CHARACTER:ESB_CORE_FLOW.Process_Message
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.ESB_CORE_FLOW_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:28.4
Insert
Type:INTEGER:5
Text:CHARACTER:SET topics = CAST(ASBITSTREAM(topicRef.rcmt:Topics) AS CHARACTER);
ParserException
File:CHARACTER:F:\build\S610_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCParser.cpp
Line:INTEGER:737
Function:CHARACTER:ImbXMLNSCParser::refreshBitStreamFromElementsCommon
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:ESB_CORE_FLOW#FCMComposite_1_2
Label:CHARACTER:ESB_CORE_FLOW.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5010
Text:CHARACTER:XML Writing Errors have occurred
ParserException
File:CHARACTER:F:\build\S610_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCWriter.cpp
Line:INTEGER:880
Function:CHARACTER:ImbXMLNSCWriter::writeMisc
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5016
Text:CHARACTER:Unexpected XML type at this point in document.
Insert
Type:INTEGER:5
Text:CHARACTER:rcmt[http://www.rei.com/1.0/rcm-topics]
Insert
Type:INTEGER:5
Text:CHARACTER:namespaceDeclType |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 22, 2010 1:15 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The exception list does not provide the full text of the message. If you are on Windows, you can get the full text from the Event Log. Otherwise you will need to take a user trace, or look up the error message in the infocenter.
When you have it, if you are still stuck, please post the full message. |
|
Back to top |
|
 |
aaron_blade |
Posted: Fri Jan 22, 2010 5:28 am Post subject: |
|
|
Apprentice
Joined: 21 Dec 2009 Posts: 29
|
Do you mean you want a complete input msg?? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 22, 2010 5:42 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I would like to see the full text of the error message. The exception list is not very useful on its own. Sorry for not making that clear. |
|
Back to top |
|
 |
aaron_blade |
Posted: Fri Jan 22, 2010 7:50 am Post subject: |
|
|
Apprentice
Joined: 21 Dec 2009 Posts: 29
|
Here is the error msg from event Manager.
( brkqm_broker.default ) The element with name ''rcmt[http://www.rei.com/1.0/rcm-topics]'' and field type ''namespaceDeclType'' is not valid as the child of Root.XML or Root.XMLNSC.
Each child of Root.XMLNSC must represent a valid XML construct for the top level of an XML document. The only field types that are valid in this position are XMLNSC.Comment or XMLNSC.ProcessingInstruction.
Ensure that the message tree is structured correctly, and that each syntax element has a valid field type. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 22, 2010 10:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The ASBITSTREAM function is expecting you to supply the root node of the message tree ( i.e. OutputRoot.XMLNSC ). You are trying to serialize a fragment of a message tree, not the whole tree. Try this:
Code: |
SET topics = CAST (ASBITSTREAM(topicRef.rcmt:Topics OPTIONS FolderBitstream ) AS CHAR ENCODING MQENC_NATIVE); |
|
|
Back to top |
|
 |
aaron_blade |
Posted: Fri Jan 22, 2010 11:08 am Post subject: |
|
|
Apprentice
Joined: 21 Dec 2009 Posts: 29
|
Thanks Knight!!
It Worked. |
|
Back to top |
|
 |
|