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 Index » WebSphere Message Broker (ACE) Support » File Input Node along with DFDL message modelling

Post new topic  Reply to topic Goto page 1, 2  Next
 File Input Node along with DFDL message modelling « View previous topic :: View next topic » 
Author Message
taankyu
PostPosted: Sun Nov 16, 2014 10:48 pm    Post subject: File Input Node along with DFDL message modelling Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Hi,
I am new to message modelling and DFDL .
I am trying to parse a flat file with header, trailer and record and send the response as XML to Websphere Business Monitor.

Test Parse model is successfull when i create the library.
Now. when I bind it to file input node and try creating XML using ESQL i start getting exceptions like:
BIP5807E: The DFDL
parser signalled that a processing error occurred. The message from
the DFDL parser is: CTDP3041E: Initiator '00' not found at offset '0'

The ESQL code I use to create an OUTPUT XML message for BAM is:

Code:
DECLARE ns1 NAMESPACE 'http:///UHGFileProj/VisionMonEvent.xsd';
      SET OutputRoot.DFDL.ns1:VisionData.(XML.NamespaceDecl)xmlns = 'http:///UHGFileProj/VisionMonEvent.xsd';      
      SET OutputRoot.DFDL.ns1:VisionData.ns1:EligBeginDate=InputRoot.DFDL.test.header.INP_CUST_ID;
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Nov 17, 2014 12:21 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Run your test message through the flow with usertrace enabled. The trace output should give you a lot more information.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Nov 17, 2014 1:31 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
when I bind it to file input node and try creating XML using ESQL i start getting exceptions like:
BIP5807E: The DFDL
parser signalled that a processing error occurred. The message from
the DFDL parser is: CTDP3041E: Initiator '00' not found at offset '0'

The ESQL code I use to create an OUTPUT XML message for BAM is:
The error that you are getting is not caused by your ESQL ( although the ESQL is wrong in several ways ). The error is being reported when the DFDL parser tries to create a message tree from the input bitstream.

I strongly advise you to do this one step at a time.
1. Create and debug the DFDL model using the Test Parse view. ( already done )
2. Create a flow that consists of an input node and a Trace node. Don't write any transformation logic until the parsing is successful. Debug the parsing using a debug-level user trace. Compare with the DFDL trace in the Test Parse view to diagnose any errors.
3. Add the nodes that perform the transformation/filterning/routing logic. Do this one step at a time, and use the message flow debugger and/or user trace to verify thee behaviour of each stage of the flow
4. Add the output node and check the output of the flow.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
taankyu
PostPosted: Mon Nov 17, 2014 6:15 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

I tried after enabling user trace and putting trace nodes:
I see the following exception
The message from the DFDL parser is:
'CTDP3000E: Unexpected end of data at byte offset '256' while parsing element '#xscd(/schemaElement::test/type::0/model::sequence/schemaElement::header/type::0/model::sequence/schemaElement::FILLER_1)'. The parser encountered the end of the data stream or the end of a parent element.'
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Nov 17, 2014 8:30 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

That exception is only the final ( reported ) symptom. The root cause may have been reported much earlier in the user trace. This is the big advantage of the DFDL trace - it can tell you *why* the error happened, as well as reporting the eventual symptoms.
So - any other errors/unexplained behaviour in the user trace?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
taankyu
PostPosted: Mon Nov 17, 2014 11:56 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Nothing else shows in trace.
I tried putting TRACE with debug level to MQ Input node .
I get exception only when I try to refer to elements from parsed message in ESQL .. othe wise no errors are shown.

Need help to move ahead
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 17, 2014 12:14 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

taankyu wrote:
Nothing else shows in trace.


Then if the product doesn't work, raise a PMR.

taankyu wrote:
I tried putting TRACE with debug level to MQ Input node .


You don't put the trace on a node; you put the trace on a flow.

taankyu wrote:
I get exception only when I try to refer to elements from parsed message in ESQL .. othe wise no errors are shown.


Because the message tree is parsed on demand, so it only tries to parse the data when you access it.

taankyu wrote:
Need help to move ahead


You could change the MQInput parsing to "Immediate" and see if that shows you more data in whatever you've set up as the trace. Or you could do a proper user trace.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Nov 18, 2014 4:22 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

I have already opened a PMR waiting for there response.

Meanwhile, I used the 'TEST PARSE MODEL' was successful.
Passed the generated XML to 'TEST SERIALIZE MODEL' and got the following error.
CTDU4076E: The DFDL serializer cannot output the text representation of element 'body_elem2'. The serialized string value '' with length '0' is less than the declared length '2' null

I have mentioned the minimum length as 2 also specified empty string.

File I am parsing has lot of fillers - how would I be able to parse such fields
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 18, 2014 6:28 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

taankyu wrote:
I have mentioned the minimum length as 2 also specified empty string.


And who have you configured the model to handle this paradox? An empty string being serialized into a field with a minimum length?

(Hint - the correct answer mentions "padding")

taankyu wrote:
File I am parsing has lot of fillers - how would I be able to parse such fields


By modelling them correctly. Like any other field.

This confuses me:

taankyu wrote:
Meanwhile, I used the 'TEST PARSE MODEL' was successful.
Passed the generated XML to 'TEST SERIALIZE MODEL' and got the following error.


When you parse a file with DFDL you don't get XML, you get a message tree, which might look a bit like XML the way it's displayed by the Toolkit but isn't. You originally said:

taankyu wrote:
I am trying to parse a flat file with header, trailer and record and send the response as XML to Websphere Business Monitor.


So you don't want or need to serialise anything with DFDL if your output is XML.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Nov 18, 2014 6:38 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

After parsing the file I need to send response as XML to output queue with some parsed values out of each record.
I am able to successfully Test Parse Model but Test Serialize was giving exceptions - removed them by setting properties
'Trim Kind'
nillable="true" dfdl:useNilForDefault="yes" dfdl:nilKind="literalValue" dfdl:nilValue="%ES;"

Do you mean I do not need to Test Serialize model ?

I need to propogate the parsed elements through ESQl and generate an output in form of XML
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 18, 2014 6:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

taankyu wrote:
After parsing the file I need to send response as XML to output queue with some parsed values out of each record.


Understand that.

taankyu wrote:
Do you mean I do not need to Test Serialize model ?


You don't need to test serialization if you not going to use the DFDL model you're testing to serialize anything. And....

taankyu wrote:
I need to propogate the parsed elements through ESQl and generate an output in form of XML


....you don't output XML using DFDL.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Nov 18, 2014 7:17 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Any suggestion or approach you can suggest -

1. I need to parse a file with header , body and trailer.
2. Create an output XML for the parsed records in ESQL.


* I have create a DFDL parser and bound it to MQ input Node.[Tested with Test Parse Model ]

* Any suggestion or link on how to propogate parsed elements to ESQL
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 18, 2014 7:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The MQInput node will parse the message data using the DFDL model.

This will then be available in ESQL in the Logical Message Tree at InputRoot.

You can then write ESQL code to create a Logical Message Tree under the OutputRoot that uses the XMLNSC parser and represents the XML document you want to create.

The XMLNSC parser will then serialize the Logical Message Tree when you pass it to an output node.

This is basic product usage.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Nov 18, 2014 7:25 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Thanx for your reply
I am exactly trying to do same using the ESQL below but getting excptions : Something wrong with my approach , its the first ESQL am writing so any help would be very useful for me


Code:
CREATE COMPUTE MODULE Test_MF_Event
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      -- CALL CopyEntireMessage();
      SET OutputRoot.DFDL.test = 2;   
      --SET OutputRoot.MQMD.Format = 'MQSTR   ';
      SET OutputRoot.DFDL.test='MQSTR   ';
      
      DECLARE ns1 NAMESPACE 'http:///UHGFileProj/TestMonEvent.xsd';
      SET OutputRoot.XMLNSC.ns1:TestData.(XML.NamespaceDecl)xmlns = 'http:///UHGFileProj/TestMonEvent.xsd';
      SET OutputRoot.XMLNSC.ns1:TestData.ns1:SubscriberID=InputRoot.DFDL.test.body.INP_BIRTH_DATE;   
      
      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;
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 18, 2014 7:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Troubleshoot the exceptions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » File Input Node along with DFDL message modelling
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.