Author |
Message
|
akbardar |
Posted: Fri Sep 12, 2014 7:46 am Post subject: Fileoutput Node wites Empty File |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
Folks:
I am using Message Broker 6(Ugrading soon). flow is going through the Fileoutput node, but, when I check AIX, it's empty. What am I missing?
I have set Data Location to be $Body. Perhaps $Body is empty?
Please advise.
Regards,
AkBar Dar _________________ AkBar Dar
IT Administrator |
|
Back to top |
|
 |
akbardar |
Posted: Fri Sep 12, 2014 7:55 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
There must be some thing I have to setup on the Compute node to populate the $Body field. Please advise.
Regards,
AkBar Dar _________________ AkBar Dar
IT Administrator |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 12, 2014 8:00 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Put a trace node right before the FileOutput, to make sure OutputRoot is associated with the correct parser. |
|
Back to top |
|
 |
akbardar |
Posted: Fri Sep 12, 2014 8:17 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
Thanks, I am receiving the Body, not the attachment. Compute node looks like below:
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
declare DFormat char 'YYYY_MM_dd';
declare adtest char;
-- Create a new message body, which will be sent as the main text of the email.
DECLARE myEmailBodyTxt CHAR;
SET myEmailBodyTxt = 'UIL Holding Job Posting is attached';
SET OutputRoot.BLOB.BLOB = CAST(myEmailBodyTxt AS BLOB CCSID 1208);
-- SET OutputRoot.XMLNS.EMail.Body.Line1 = 'An email + attachement';
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentType = 'text/plain';
SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'UIL_CB_Backedout_Message_'||cast(CURRENT_DATE as char)||'_'||cast(CURRENT_TIME as char)||'.txt';
-- SET OutputLocalEnvironment.Destination.Email.Attachment.ContentEncoding = '7bit'; _________________ AkBar Dar
IT Administrator |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 12, 2014 9:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
akbardar wrote: |
CALL CopyMessageHeaders();
CALL CopyEntireMessage(); |
Why are you calling both of these? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Sep 12, 2014 9:50 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
And, have you set the Comput Node 'Mode' to pass the LocalEnvironment?
In your trace node add the following
Code: |
==Local Env==
${LocalEnvironment}
|
and you will see if you are passing the data to the FileOutput Node. _________________ 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 |
|
 |
Vitor |
Posted: Fri Sep 12, 2014 9:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
And, have you set the Comput Node 'Mode' to pass the LocalEnvironment?
In your trace node add the following
Code: |
==Local Env==
${LocalEnvironment}
|
and you will see if you are passing the data to the FileOutput Node. |
I want to know why the OP is passing something clearly intended to be an email and an attachment to a FileOutput node not an EmailOutput node. I do hope it's because he's trying to write out the txt file for the email to pick up and attach...(!)
Puts unnecessarially calling both of the Header procedures into perspective.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
akbardar |
Posted: Fri Sep 12, 2014 10:21 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
Yes; I am emailing the content as attachment and want to write the content ( SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;) to the fileoutput node.
But, I only get the $body of the Email in the fileoutput node not the attachment. How do I get the BLOB into the fileoutput node.
I put the Trace Node before the Fileoutput node with ${LocalEnvironment}
Please advise.
Regards,
AkBar Dar _________________ AkBar Dar
IT Administrator |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 12, 2014 10:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Ok.
So, $Body points to Root.<LastChild>
Your attachment is under LocalEnvironment, not Root.
If you want to write out a file that contains an email message with all of it's parts, you need to write out a MIME message.
Which means you need to change your code to produce a MIME message.
But it's still not clear to either Vitor or I what is going to read this file and send an email message. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 12, 2014 10:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
But it's still not clear to either Vitor or I what is going to read this file and send an email message. |
Are you trying to email the attachment and write it to the file system? That would make a marginal amount of sense. Given nothing else does.
If that's what you're trying to do, then the insight of my most worthy associate is right on the money re your problem. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
akbardar |
Posted: Fri Sep 12, 2014 11:03 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
I am emailing the attachment and want to write out the attachment to the file. I cannot seem to only write the attachment.
I put it to debugger and this how my LocalEnvironment looks like:
LocalEnvironment
Destination
Email
Attachment
ContentType:CHARACTER:text/plain
Content:BLOB:[B@14f014f0
ContentName:CHARACTER:UIL_CB_Backedout_Message_DATE '2014-09-12'_TIME '14:59:31.215617'.txt
WrittenDestination
Email
smtpServer:CHARACTER:hqln1
messageId:CHARACTER:<984955573.71410548374090.JavaMail.mbqat@uxqm2> _________________ AkBar Dar
IT Administrator |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 12, 2014 11:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
akbardar wrote: |
I am emailing the attachment and want to write out the attachment to the file. |
Ok. Weird, but I've seen weirder business requirements. Given that:
akbardar wrote: |
ContentName:CHARACTER:UIL_CB_Backedout_Message_DATE '2014-09-12'_TIME '14:59:31.215617'.txt |
What's the problem? Aside from using the debugger when you claim to have a Trace node?
If the problem is you're expecting this to automagically jump into your file with the email body because it was sent as an attachment to the email, or indeed automagically end up anywhere near your file then yes, that's a problem because it won't.
You've built an email with an attachment and sent it. Now you need to construct a file a write it.
(Hint: why does the email body come out in the file?) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|