|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Accessing XML message in java plug-in |
« View previous topic :: View next topic » |
Author |
Message
|
vjv18bet |
Posted: Wed Aug 14, 2002 2:24 am Post subject: Accessing XML message in java plug-in |
|
|
Newbie
Joined: 14 Aug 2002 Posts: 1
|
Hi,
I have to develop custom java plug-in that will receive XML message and pass it to another application (DLL). I don't need to parse this XML, just throw it out. The problem is that I don't know how to get the XML message from the assembly as is. Can you provide me some example how to do this? Any help would be appreciated. _________________ Regards |
|
Back to top |
|
 |
kirani |
Posted: Thu Aug 15, 2002 3:44 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
In your evaluate method, first extract the Message tree from Message Assembly, using
Code: |
MbMessage msg = messageAssembly.getMessage();
|
Now, get the data buffer for the message.
Code: |
byte[] messagetext = msg.getBuffer();
|
Now you could pass this extracted message buffer messagetext to your DLL. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
jmbdel |
Posted: Mon Aug 19, 2002 5:45 am Post subject: Accessing XML message in Java plugin |
|
|
Newbie
Joined: 22 Apr 2002 Posts: 4
|
Hi,
The getBuffer() method is OK to get the entire message, but is it possible to get the XML part only ? this means message without the headers. |
|
Back to top |
|
 |
kirani |
Posted: Mon Aug 19, 2002 7:24 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
I don't think there is any API/Utility function to retrieve XML message body at once. You will need a function like BITSTREAM, which will return byte stream of the parsed XML tree.
If your message is in BLOB domain, you could use existing API functions to retrive message body. Use combination of getRootElement, getFirstElementByPath and getValue utility functions.
I hope this helps. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
jmbdel |
Posted: Tue Aug 20, 2002 3:52 am Post subject: |
|
|
Newbie
Joined: 22 Apr 2002 Posts: 4
|
Thanks Kiran, I thaught on this possibility already, but didn't try, because I need to change the domain between the MQInput and the plugin. I would like to use the next future possibility of schema checking. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|