Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:06:36+00:00 2026-06-07T01:06:36+00:00

I have a destination which sends an HL7 v2 message to a WCF webservice.

  • 0

I have a destination which sends an HL7 v2 message to a WCF webservice. I’ve managed to get the message correctly to the webservice (after fixing various encoding problems) and I can confirm that the message is reaching the WCF endpoint correctly. However, after much hunting around in the forums and documentation, I am unable to correctly parse the ACK we receive back to indicate when an error has occurred.

The response coming back from the webservice looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header/>
    <s:Body>
        <ProcessMessageResponse xmlns="http://www.bluewire-technologies.com/webservices">  
            <ProcessMessageResult>
               MSH|^~\&amp;|Epro|RGR|||||ACK||D||||||GBR|ASCII|
               MSA|AE||Empty message|
               ERR|^^^100|
            </ProcessMessageResult>
        </ProcessMessageResponse>
    </s:Body>
</s:Envelope>

The response contains an ACK in the ProcessMessageResult element. How to I extract this ACK from the response and pass it as the output of the destination? Will Mirth automatically parse the ACK and determine that there was an error?

I had thought that I needed some kind of transformer on the destination (called ‘SOAP’) and use something along the lines of:

var xml = responseMap.get('SOAP').getMessage(); 

and then extract the ProcessMessageResponse element but responseMap.get(‘SOAP’) returns null so that seems the wrong approach.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:06:37+00:00Added an answer on June 7, 2026 at 1:06 am

    I’ve now solved part of this thanks to an answer on the Mirth forums.

    To summarize, I use the following postprocessor to extract the ack and update the status:

    var s = new Namespace('http://schemas.xmlsoap.org/soap/envelope/');
    var bw = new Namespace('http://www.bluewire-technologies.com/webservices');
    
    var response = new XML($r('SOAP').getMessage());
    var ack = new XML(SerializerFactory.getHL7Serializer().toXML(response.s::Body.bw::ProcessMessageResponse.bw::ProcessMessageResult.toString()));
    
    var ackCode = ack.MSA['MSA.1']['MSA.1.1'].toString();
    if(ackCode == 'AE')
    {
        var errorMessage = ack.MSA['MSA.3']['MSA.3.1'].toString();
        var messageController = com.mirth.connect.server.controllers.DefaultMessageObjectController.create();
        var channelStatisticsController = com.mirth.connect.server.controllers.DefaultChannelStatisticsController.create();
    
        messageObject.getContext().put("replace", "true"); // yuk - this is to make setError below work.
        messageController.setError(messageObject, null, errorMessage, null, null);
        channelStatisticsController.decrementSentCount(new java.lang.String(channelId));
    }
    

    Not pretty, but it works…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in a prepareForSegue method // Get destination view UIViewController *viewController
We have a load balanced (NLB) ASP.NET web app which sends email. The servers
i have developed one windows (desktop) based application which sends pdf as an attachments.
I'm using Parsley in my flex mobile project. I have multiple destination services but
I have the following destination , image and destination_image tables: (MYSQL): destination: id_destination image:
I have a table set up as follows id origin destination carrier_id so typical
I have an OLE DB Data source and a Flat File Destination in the
I have a particular method that is occasionally crashing with an ArgumentException: Destination array
I have two identical SQL Server tables ( SOURCE and DESTINATION ) with lots
I have mambo 4.6.5 on my source site and joomla 1.5 on destination site.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.