ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker Supportparse DFDL from message flow

Post new topicReply to topic
parse DFDL from message flow View previous topic :: View next topic
Author Message
sarwan
PostPosted: Tue Dec 04, 2018 10:13 pm Post subject: parse DFDL from message flow Reply with quote

Newbie

Joined: 04 Dec 2018
Posts: 3

How to parse DFDL from message flow like we parse from message DFDL test(Test Parse Mode or Test Serialize Model) ?

If i use mapping node from flow it only transform values but not focusing on DFDL properties or restrictions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 05, 2018 6:01 am Post subject: Re: parse DFDL from message flow Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25361
Location: Ohio, USA

sarwan wrote:
If i use mapping node from flow it only transform values but not focusing on DFDL properties or restrictions.


Read through the discussion on this recent thread.

As my worthy associate points out, the Mapping node acts against the logical message tree not the message stream. This, for the record, is true of all WMB/IIB/ACE nodes and has been since it was called MQSI.

The only times a DFDL model is invoked is on input (when the message stream is parsed into the message tree) and on output (when the message tree is serialized). Nodes that do this have colored stripes to identify them.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sarwan
PostPosted: Wed Dec 05, 2018 9:56 pm Post subject: parse DFDL from message flow Reply with quote

Newbie

Joined: 04 Dec 2018
Posts: 3

Thanx for reply,
flow: input -> javaCallOut->ResetContentDescriptor->Trace
Sir, i got blob response from java compute using:
i.e
Code:

rootElement.getLastChild().delete();
rootElement.createElementAsLastChild(MbElement.TYPE_NAME, "DFDL", null).createElementAsLastChild(MbElement.TYPE_NAME, "TFRes_DFDL", null).createElementAsLastChild(MbElement.TYPE_NAME, "body", null).createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "body_elem1", resMsg.getBytes());

which returns:

Local Enviroment
Exception List
Message
<message>
<Properties>
</Properties>
<HTTPInputHeader>
</HTTPInputHeader>
<DFDL>
<TFRes_DFDL>
<body>
<body_elem1>5048584744434932303030303032313032303138313132373134353833303138303030303030313720202020202020202020202030303032303030303031313030202020202020202020202020202020202030313832303138313132373134353833303138313132373131313930362020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203131313930363130</body_elem1>
</body>
</TFRes_DFDL>
</DFDL>
</message>


and then, i set reset content descriptor node with properties:
1)Message domain: DFDL for binary or text ....................
2)Message: browsed DFDL which is:

Code:

<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions" xmlns:recFixLengthFieldsFmt="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat">

    <xsd:import namespace="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat" schemaLocation="IBMdefined/RecordFixLengthFieldFormat.xsd"/>
    <xsd:annotation>
      <xsd:appinfo source="http://www.ogf.org/dfdl/">
         <dfdl:format encoding="UTF-8" escapeSchemeRef="" occursCountKind="fixed" ref="recFixLengthFieldsFmt:RecordFixLengthFieldsFormat"/>
      </xsd:appinfo>
   </xsd:annotation>

   <xsd:element dfdl:lengthKind="delimited" ibmSchExtn:docRoot="true" name="TFRes_DFDL">
      <xsd:complexType>
         <xsd:sequence dfdl:separator="%CR;%LF;%WSP*;" dfdl:separatorSuppressionPolicy="anyEmpty">
                        <xsd:element dfdl:lengthKind="delimited" name="body">
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:element dfdl:length="239" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:textPadKind="padChar" dfdl:textTrimKind="none" dfdl:truncateSpecifiedLengthString="yes" name="body_elem1" type="xsd:hexBinary">
                              </xsd:element>
                                                            </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
</xsd:schema>


reset content descriptor node returns:

Code:

<message>
<Properties>
</Properties>
<HTTPInputHeader>
</HTTPInputHeader>
<Root>
<TFRes_DFDL>
<body>
<body_elem1>5048584744434932303030303032313032303138313132373134353833303138303030303030313720202020202020202020202030303032303030303031313030202020202020202020202020202020202030313832303138313132373134353833303138313132373131313930362020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020203131313930363130</body_elem1>
</body>
</TFRes_DFDL>
</Root>
</message>


how can i see the original string message which was converted in bytes by java callout? i mean i am unable to trace, and if i covert bytes using DFDL Test(Serialize test model) it returns back the same string, then why not in flow ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 06, 2018 5:27 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25361
Location: Ohio, USA

Running a message tree through a RCD node to associate it with a DFDL model doesn't count as output and doesn't serialize the flow. Hence DFDL is not invoked (as I explained above).

Likewise the Trace node displays IIB's internal message tree and doesn't use DFDL.

I suspect the problem is the createElementAsLastChild, which is associating the bytes with DFDL but not actually building the message tree. The problem is that I don't write Java worth a contact admin so don't know what you're doing wrong, but in ESQL I'd use the CREATE .... PARSE construct to get the bytes into a message tree.

Someone Java literate will be along in a moment I'm sure.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Dec 06, 2018 6:04 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19816
Location: LI,NY

Your problem is in your DFDL setup.
You have set up your DFDL to have a body with a BLOB.
What you want to do is define the BLOB as a DFDL message
Describe the message in DFDL
and use at the DFDL parser level the create as last child from bitstream passing the domain as DFDL and passing the Message...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sarwan
PostPosted: Thu Dec 06, 2018 8:08 am Post subject: Reply with quote

Newbie

Joined: 04 Dec 2018
Posts: 3

Thank you dears,
With your help i found the problem and made it correct.
I just use bitStream method of lastChild and got message as BLOB
Code:

<BLOB>
<BLOB>.</BLOB>
</BLOB>

and passed it to RCD using domain and message checks.

just one thing still unable to use trace in IIB ?
Back to top
View user's profile Send private message
timber
PostPosted: Fri Dec 07, 2018 12:18 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 889

Quote:
just one thing still unable to use trace in IIB
You need to run three commands:
mqsichangetrace to enable user trace. Use the -r flag to reset it
[now put your message through the flow]
mqsichangetrace to disable user trace. Without the -r flag (obviously!)
mqsireadlog to read the trace as an XML file
mqsiformat log to convert the XML file into readable text
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker Supportparse DFDL from message flow
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.