Author |
Message
|
zleilei |
Posted: Tue Dec 21, 2010 9:50 pm Post subject: How to send mutiple attachments by JMS. |
|
|
Newbie
Joined: 21 Dec 2010 Posts: 4
|
Dear:
Now I need to send mutiple attachments by WMB. I choose the JMS as application client and transfer the attachments to bytes . But I don't know how to split the bytes on Compute Node.
In my message flow, the input node is MQInput, and the output node is SoapRequest. And the SoapRequest Node need multiple attachments exist as
byte[] .
What will I do? Do I need to use the FTE(File Transfer Editon)? Or any other suggestions for sending mutiple attachments for one output node. And the JMS is better. |
|
Back to top |
|
 |
mgk |
Posted: Wed Dec 22, 2010 1:59 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello.
If you use 7.0.0.1 or 7.0.0.2 the SOAP Request node itself can send SOAP with Attachment messages (SwA) with as many attachments as you like over HTTP or JMS transports. Simply use the SOAP Parser to build the SwA message. See the infocenter for more details...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
zleilei |
Posted: Wed Dec 22, 2010 3:00 am Post subject: |
|
|
Newbie
Joined: 21 Dec 2010 Posts: 4
|
Hi, Thanks for your reply.
Actually, I don't know what I will do if one message contain two types of data by JMS,such as bytes and string.
Now I transfer the string message to bytes and combine with the former bytes. But I have no idea how to split them back to their own through WMB.
Any suggestion?
I use the method named writebytes() and writeUTF() of JMS BytesMessage(Java Class).
But the two bytes will be in one message. |
|
Back to top |
|
 |
zpat |
Posted: Wed Dec 22, 2010 3:34 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You could change the bytes to string, using BASE64. |
|
Back to top |
|
 |
mgk |
Posted: Wed Dec 22, 2010 3:44 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I use the method named writebytes() and writeUTF() of JMS BytesMessage(Java Class). |
The SOAP/JMS Spec supported by WMB only allows either a Text message or a Bytes message. And if it is a Bytes message it must be entirely written with writeBytes and the broker will receive it with readBytes only.
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
zleilei |
Posted: Wed Dec 22, 2010 4:42 am Post subject: |
|
|
Newbie
Joined: 21 Dec 2010 Posts: 4
|
zpat wrote: |
You could change the bytes to string, using BASE64. |
Assuming the bytes parameter name is "outs", I use the following method:
outs.toString(). But the outs will be changed into the string format, and the original format will lose.
How about your method?
Could you give me the Java method for transferring the bytes to string? And I can get back the format of the bytes in Compute node?
Thanks very much! |
|
Back to top |
|
 |
zleilei |
Posted: Wed Dec 22, 2010 4:44 am Post subject: |
|
|
Newbie
Joined: 21 Dec 2010 Posts: 4
|
mgk wrote: |
And if it is a Bytes message it must be entirely written with writeBytes and the broker will receive it with readBytes only.
Kind Regards, |
Thanks . But if the bytes contain two parts, how I will split them by ESQL?
Any advices? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 22, 2010 4:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should, in general, never use writeUTF anyway. Instead you should use writeString with a properly formatted UTF string as the source.
You should, in general, when trying to figure out how to process a message in broker - using either Java or ESQL - use a Trace node to give you an output that shows what the structure of the message you are receiving IS.
Then you can figure out how to write ESQL or Java code to transform that message according to your requirements.
Nobody has nearly enough information about your problem - other than you - to answer "how to split it with ESQL". |
|
Back to top |
|
 |
mgk |
Posted: Wed Dec 22, 2010 5:57 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Is is a SOAP (with attachments?) message? If it is, the the SOAPRequest node will split it for you automatically. If it is not a SOAP message then you cannot use the SOAP request node at all and you will have to use the JMS nodes...
regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|