Author |
Message
|
Deepali |
Posted: Thu Jul 25, 2013 11:40 pm Post subject: Base64Binary Conversion |
|
|
Novice
Joined: 05 Mar 2013 Posts: 19
|
Hi All,
We are putting base64binary data from input xml into an xml element of type string in outputroot. At this point the original base64binary data looks like hex binary format. Now in the receiver flow we want to convert the string element back to original base64binary.
We have tried different casts and encoding-decoding from help content. But not able to do the required. We are working on WMB v8.0.0.1
Any help is appreciated.javascript:emoticon(' ')
Thanks. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Jul 25, 2013 11:48 pm Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
Did you try to cast hex string first to BLOB and then decode it?
--
Marko |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 26, 2013 1:24 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
We are putting base64binary data from input xml into an xml element of type string in outputroot. At this point the original base64binary data looks like hex binary format. |
That is ( probably ) because XMLNSC has decoded the base64Binary into a byte array. In the message tree, the field is an ESQL 'BLOB'. Put in a Trace node if you want to verify that.
Quote: |
Now in the receiver flow we want to convert the string element back to original base64binary. |
Here's one solution. Instead of fixing the receiver flow, modify this message flow so that it leaves the base64Binary data alone.
- open the input node properties
- find the 'Parser Options' section
- deselect 'Build tree using XML Schema types'.
This will cause the message tree to be built using CHARACTER types, and the base64Binary field will pass through the flow unchanged. Not sure whether that meets the requirements because you haven't told us very much about the rest of the flow... _________________ 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 |
|
 |
Deepali |
Posted: Fri Jul 26, 2013 3:23 am Post subject: |
|
|
Novice
Joined: 05 Mar 2013 Posts: 19
|
Thanks all,
for quick reply. The problem has been solved. We just put the input xml on Environment tree with 'XMLNSC' domain and it worked.
 |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 26, 2013 3:37 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The problem has been solved. We just put the input xml on Environment tree with 'XMLNSC' domain and it worked |
That sounds like an over-complicated solution. Why do you need to put anything into the Environment tree? _________________ 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 |
|
 |
mqjeff |
Posted: Fri Jul 26, 2013 4:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kimbert wrote: |
Quote: |
The problem has been solved. We just put the input xml on Environment tree with 'XMLNSC' domain and it worked |
That sounds like an over-complicated solution. Why do you need to put anything into the Environment tree? |
It sounds actually like the original problem diagnosis was incorrect, that the flow has all along been copying data into Environment tree, but doing so incorrectly. And so the parser-specific information about the hex binary field was lost, and so when the field was put back into the output tree, it was no longer an XMLNSC hex binary field, it was just a plain character string. And thus corrupted on output.
So doing the right thing to copy the field in the first place corrected the actual problem, rather than trying to fix the wrong problem. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 26, 2013 6:10 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
@mqjeff: Well spotted - that's probably the explanation. _________________ 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 |
|
 |
|