web stats
Sending Encoded Base 64 and Decoding with Webservice - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2015, 11:13 AM
Prolasis Prolasis is offline
Mirth Newb
 
Join Date: Apr 2015
Posts: 13
Prolasis is on a distinguished road
Default Sending Encoded Base 64 and Decoding with Webservice

Hi there i am trying to base64 decode some text i am sending through the webservice. Just testing for now and planing to send a CCD instead, but i noticed when using my code below on the source transformer my varialbe shows as "[B@5325185c" instead of the decoded data. Anyone have an idea of whats wrong. Maybe it the way i am decodeing the data in JS.

Sample Soap
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.connectors.connect.mirth.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:acceptMessage>
         <!--Optional:-->
         <arg0>SSBhbSBkZWNvZGVk</arg0>
      </ws:acceptMessage>
   </soapenv:Body>
</soapenv:Envelope>
JS code
Code:
var Decoded = FileUtil.decode(connectorMessage.getRawData()); 


channelMap.put('Variable1',Decoded);
Reply With Quote
  #2  
Old 09-04-2015, 07:52 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

FileUtil.decode returns a byte array. Use "new java.lang.String(bytes, charset)" to convert that to a string.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
ccd, ccda, soap, webservice, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation