Announcement

Collapse
No announcement yet.

Sending Encoded Base 64 and Decoding with Webservice

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 "[[email protected]" 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);

  • #2
    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.

    Comment

    Working...
    X