Author |
Message
|
shashivarungupta |
Posted: Tue Aug 26, 2014 3:08 pm Post subject: ParserException : when sending XMLNSC to MQOutput Node |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Hi,
As a part of some message flow designing.. I am getting a silly ParserException.
Code: |
ParserException
File:CHARACTER:F:\build\slot1\S800_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCWriter.cpp
Line:INTEGER:953
Function:CHARACTER:ImbXMLNSCWriter::writeMisc
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:5016
Text:CHARACTER:Unexpected XML type at this point in document.
Insert
Type:INTEGER:5
Text:CHARACTER:Response
Insert
Type:INTEGER:5
Text:CHARACTER:folderType |
Following is the code, where some fields are coded with ESQL to generate an XMLNSC output message to the MQOutput Node, which is directly connected to the Out Terminal of this Compute Node 'PositiveMessageBuilding'. The compute mode of the compute node is set to have 'Message'.
Quote: |
CREATE COMPUTE MODULE MechanismMFlow1_PositiveMessageBuilding
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
SET Environment.MQMD = InputRoot.MQMD;
CALL CopyEntireMessage();
-- LOGIC BLOCK STARTS
DECLARE FN CHARACTER NULL;
SET FN = InputRoot.XMLNSC.DETAILS.PERSONAL.NAME.FIRSTNAME ;
SET OutputRoot.XMLNSC.Response.Agreed VALUE = 'YES';
-- LOGIC BLOCK ENDS
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE; |
Any suggestion.  _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Tue Aug 26, 2014 5:01 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
My bad, I didn't supply the input message(example) with the question(OP) earlier, to make the things more clear.
Quote: |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DETAILS>
<PERSONAL>
<NAME>
<FIRSTNAME>abc</FIRSTNAME>
<MIDDLENAME>def</MIDDLENAME>
<LASTNAME>ghi</LASTNAME>
</NAME>
<PRIMARYAPPLICANT>Y</PRIMARYAPPLICANT>
<FAMILYMEMBERS>3</FAMILYMEMBERS>
<DOB>18122014</DOB>
</PERSONAL>
</DETAILS> |
_________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
vishnurajnr |
Posted: Tue Aug 26, 2014 6:07 pm Post subject: |
|
|
 Centurion
Joined: 08 Aug 2011 Posts: 134 Location: Trivandrum
|
Quote: |
CALL CopyEntireMessage();
.....
SET OutputRoot.XMLNSC.Response.Agreed VALUE = 'YES'; |
This statement is causing the issue since it will create two XML Root elements which is not as per the XML standards.
It can be like :
Quote: |
SET OutputRoot.XMLNSC.DETAILS.Response.Agreed VALUE = 'YES'; |
|
|
Back to top |
|
 |
shashivarungupta |
Posted: Tue Aug 26, 2014 6:52 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
vishnurajnr wrote: |
Quote: |
CALL CopyEntireMessage();
.....
SET OutputRoot.XMLNSC.Response.Agreed VALUE = 'YES'; |
This statement is causing the issue since it will create two XML Root elements which is not as per the XML standards.
It can be like :
Quote: |
SET OutputRoot.XMLNSC.DETAILS.Response.Agreed VALUE = 'YES'; |
|
Thanks a lot for this valuable input.
And if I don't take the Payload/Message Data from InputRoot by calling CopyEntireMessage() to OutputRoot ., and wanted to set the new XML Root field to the output message, how that can be done ? _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 26, 2014 7:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The same way you assign part A of the input tree to part B of the output tree.
You should be able to find enough examples for instance in the SOAP examples with the SOAP extract subflows...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|