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 » Converting MQ message to BLOB then BLOB to character

Post new topic  Reply to topic
 Converting MQ message to BLOB then BLOB to character « View previous topic :: View next topic » 
Author Message
ksrocks9
PostPosted: Wed Sep 02, 2015 9:37 am    Post subject: Converting MQ message to BLOB then BLOB to character Reply with quote

Apprentice

Joined: 11 Mar 2015
Posts: 35

I am getting problem in converting InputBody to BLOB using ASBITSTREAM and then again BLOB to character. It's able to convert the Web service I am getting problem in converting MQ message. I am using this for tracking all the messages.

IF InputRoot.Properties.ReplyProtocol = 'SOAP-AXIS2' THEN

SET TrkBlob = ASBITSTREAM(InputBody);
SET TrkChar = CAST(TrkBlob AS CHAR CCSID 437);
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.CDataField)Body = TrkChar;

ELSE
SET Environment.Variables.InputTree = InputBody;

SET TrkBlob = ASBITSTREAM(Environment.Variables.InputTree, InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);
SET TrkChar = CAST(TrkBlob AS CHAR CCSID InputRoot.MQMD.CodedCharSetId);
SET OutputRoot.XMLNSC.Envelope.(XMLNSC.CDataField)Body = TrkChar;
END IF;

Help me to solve this problem.

Thanks in advance.
Back to top
View user's profile Send private message
timber
PostPosted: Wed Sep 02, 2015 9:54 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Quote:
It's able to convert the Web service I am getting problem in converting MQ message.
Please explain exactly what the problem is.
Quote:
I am using this for tracking all the messages.
Have you considered using the built in monitoring facilities provided by IIB?
Back to top
View user's profile Send private message
ksrocks9
PostPosted: Wed Sep 02, 2015 10:36 am    Post subject: Reply with quote

Apprentice

Joined: 11 Mar 2015
Posts: 35

I am getting error Invalid wire format. When it tries to convert to BLOB.

When cursor goes to this statement
SET TrkBlob = ASBITSTREAM(Environment.Variables.InputTree, InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);

I am getting INVALID WIRE FORMAT.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 02, 2015 10:40 am    Post subject: Reply with quote

Grand High Poobah

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

ksrocks9 wrote:
I am getting error Invalid wire format. When it tries to convert to BLOB.


I would theorize that the data stream contains characters which are valid in an MQ message but not valid (even in a CData section) in an XML document. If so, you'll need to escape them in the output document. Or the two CCSIDs don't match.

Alternatively use the inbuilt facilities to do this, as the other poster suggested, rather than further complicate this wheel you've invented.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Wed Sep 02, 2015 10:41 am; edited 1 time in total
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Sep 02, 2015 10:40 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.

Did you assign a parser when you created this

Environment.Variables.InputTree
_________________
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
ksrocks9
PostPosted: Wed Sep 02, 2015 12:06 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Mar 2015
Posts: 35

I didn't assign any parser to Environment.Variables.InputTree.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 02, 2015 12:52 pm    Post subject: Reply with quote

Grand High Poobah

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

ksrocks9 wrote:
I didn't assign any parser to Environment.Variables.InputTree.


That's not going to help even if it's not a problem here.

I'm still interested in why you're not using the inbuilt facilities.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 02, 2015 7:44 pm    Post subject: Reply with quote

Grand High Poobah

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

In order to get ASBITSTREAM to work you need to have a PARSER assigned to the Tree... in this case the Environment tree.
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Thu Sep 03, 2015 12:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Quote:
I am getting error Invalid wire format. When it tries to convert to BLOB.
Excuse me for being picky but...'Invalid wire format' is not an error message. Not even close.

An error message consists of:
- a name in the form 'BIPnnnnE'. BIP5285E, for example.
- a Summary line that appears in the exception list and the syslog
- a Description that tells you why the problem happened ( hopefully )
- a User Action section that tells you what you ( as a user ) can do about it.

I suspect that you are only looking at the Exception List. I strongly recommend that you look up the full text of the error message ( you can use command line utility mqsiexplain for that ).
https://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bn23805_.htm.

When you have found the full text of the error, please post it here.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Sep 03, 2015 3:05 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.

timber wrote:
Quote:
I am getting error Invalid wire format. When it tries to convert to BLOB.
Excuse me for being picky but...'Invalid wire format' is not an error message. Not even close.


While you are corrent, I have seen the words 'Invalid Wire format' a good number of times in my 'n' years of working with this product.

Most of the time is was when woring with the MRM Parser and CWF messages.
If the message did not agree with the model you could get this message.
_________________
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
inMo
PostPosted: Thu Sep 03, 2015 6:00 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

Quote:
I am getting error Invalid wire format. When it tries to convert to BLOB.

When cursor goes to this statement
SET TrkBlob = ASBITSTREAM(Environment.Variables.InputTree, InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);


How did the data get into Environment.Variables.InputTree? What data do you think is there?
Back to top
View user's profile Send private message
timber
PostPosted: Thu Sep 03, 2015 10:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

@smdavies99 : My point ( not very well explained ) is that 'Invalid wire format' is only a very small part of the error. The OP, like many users of IIB, is missing out on a lot of information if they do not look up the full error message using mqsiexplain ( or alternatively, take a user trace ).
Back to top
View user's profile Send private message
ksrocks9
PostPosted: Thu Sep 03, 2015 1:11 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Mar 2015
Posts: 35

This is my total exception list , Instead using asbitstream I am directly copying the input tree.


Exception List:
RecoverableException
Code:
File:CHARACTER:F:\build\slot1\S900_P\src\DataFlowEngine\PluginInterface\ImbJniNode.cpp
         Line:INTEGER:1311
         Function:CHARACTER:ImbJniNode::evaluate
         Type:CHARACTER:ComIbmMQHeaderNode
         Name:CHARACTER:TEST/TEST_Req#FCMComposite_1_17
         Label:CHARACTER:TEST.TEST_Req.Add MQ Header
         Catalog:CHARACTER:BIPmsgs
         Severity:INTEGER:3
         Number:INTEGER:2230
         Text:CHARACTER:Caught exception and rethrowing
         Insert
               Type:INTEGER:14
               Text:CHARACTER:TEST.TEST_Req.Add MQ Header
         RecoverableException
               File:CHARACTER:F:\build\slot1\S900_P\src\DataFlowEngine\SQLNodeLibrary\ImbComputeNode.cpp
               Line:INTEGER:497
               Function:CHARACTER:ImbComputeNode::evaluate
               Type:CHARACTER:ComIbmComputeNode
               Name:CHARACTER:TEST/TEST_Req#FCMComposite_1_6.LOGGING/INT_MSG_TRACKING#FCMComposite_1_1
               Label:CHARACTER:TEST.TEST_Req.MSG_TRACKING.Setup Tracking Message
               Catalog:CHARACTER:BIPmsgs
               Severity:INTEGER:3
               Number:INTEGER:2230
               Text:CHARACTER:Caught exception and rethrowing
               Insert
                     Type:INTEGER:14
                     Text:CHARACTER:TEST.TEST_Req.MSG_TRACKING.Setup Tracking Message
               RecoverableException
                     File:CHARACTER:F:\build\slot1\S900_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
                     Line:INTEGER:699
                     Function:CHARACTER:SqlStatementGroup::execute
                     Type:CHARACTER:
                     Name:CHARACTER:
                     Label:CHARACTER:
                     Catalog:CHARACTER:BIPmsgs
                     Severity:INTEGER:3
                     Number:INTEGER:2488
                     Text:CHARACTER:Error detected, rethrowing
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:LOGGING.Tracking_Message.Main
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:23.9
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:SET TrkBlob = ASBITSTREAM(InputBody);
                     ParserException
                           File:CHARACTER:F:\build\slot1\S900_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbSyntaxElement.cpp
                           Line:INTEGER:702
                           Function:CHARACTER:CpContext::loadWorker
                           Type:CHARACTER:
                           Name:CHARACTER:
                           Label:CHARACTER:
                           Catalog:CHARACTER:BIPmsgs
                           Severity:INTEGER:3
                           Number:INTEGER:5136
                           Text:CHARACTER:Invalid Wire format retreived.
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:


Thanks for your help appreciated.
Back to top
View user's profile Send private message
timber
PostPosted: Thu Sep 03, 2015 2:00 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

See my first reply. The Exception List is not giving you the information that you need. You need to use mqsiexplain to get the full text of error message BIP2488. Or use Google to do the same thing.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 03, 2015 9:36 pm    Post subject: Reply with quote

Grand High Poobah

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

This is the one that seems relevant here:
Quote:
BIP5136E: Invalid Wire Format Identifier 'insert1'.
When processing an MRM message the integration node requires a valid wire format identifier.
Check that you have packaged the message correctly and set the correct message properties then resubmit the message.

There is no wire format being specified in the ESQL code for ASBITSTREAM...
This is usually in the Properties.MessageFormat or something like it...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting MQ message to BLOB then BLOB to character
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.