|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to transfer binary array to webservice |
« View previous topic :: View next topic » |
Author |
Message
|
topyp |
Posted: Wed May 21, 2014 7:17 am Post subject: How to transfer binary array to webservice |
|
|
Newbie
Joined: 06 Dec 2010 Posts: 7
|
Call a webservice in wmb 6.1, and the message includes a binary array which is generated by a java program.I use java node to output the message.There are a compute node and a httprequest node behind java node.
Code: |
byte [] Qty=Main.read();
MbElement out2=out1.createElementAsLastChild(MbXMLNSC.FIELD, "quantity", Qty);
|
But from java node's out terminal, the binary array changes to a hex string.I wanna know how to cast it to byte[] in compute node.But I think from compute node's out terminal , the binary arrary still is output as hex string before httprequest node.How to transfer binary array to webservice.I need help ,Thanks! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 21, 2014 9:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Unless your Qty field holds a png or jpeg it should really be defined as either int or double or long... or float. Please don't define it as byte[].  _________________ MQ & Broker admin |
|
Back to top |
|
 |
topyp |
Posted: Wed May 21, 2014 5:47 pm Post subject: |
|
|
Newbie
Joined: 06 Dec 2010 Posts: 7
|
The webservice is provided by government deparment , so we have no choice.If wmb can't realize , we only use java do it.
fjb_saper wrote: |
Unless your Qty field holds a png or jpeg it should really be defined as either int or double or long... or float. Please don't define it as byte[].  |
|
|
Back to top |
|
 |
kimbert |
Posted: Wed May 21, 2014 9:57 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
WMB can write any valid XML document. If you want to send a byte array in an XML document then you need to encode the bytes as hexBinary or base64Binary. _________________ 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 |
|
 |
|
|
 |
|
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
|
|
|
|