Mirth Connect custom ACK - web-services

I've just entered in the Mirth Connect world.
I've some problem to generate a custom ACK for my applications.
Here how it must to work:
The channel must to receive HL7 v2 message, it transforms message, and sends it to 3 destinations:
1. File writer -> it write base64 file into a file
2. Database writer -> it write in my table the reference of the files, with other data.
3. Webservice writer -> it send some other data to a soap server, and get a response.
Step 1, 2, and 3 works... but at the end of the 3rd step, I must to collect some response data of the Webservice, and i must to create a custom Hl7 ACK for send back to the source.
I don't know how to read response from 3rd destination and create hl7 ack to send back to the source.
Can somebody help me in this!?
Thanks.

Here the solution:
I get every source data with:
message.getConnectorMessages().get(0).getRawData();
I convert it in XML.
Later, i create a new Hl7 Message
var new hl7 = new XML("<HL7Message/>");
and I append all the childnodes and i use some values from source xml.
At the end, I convert "hl7" variable in HL7, and I put it on the ResponseMap...
All this one in the PostProcessor, and I select this one as ACK in the source tab.

Related

Modify Metadata during Grpc Bidirectional Streaming in C++

Using Async bidirectional streaming, can i create a client stream (ClientAsyncReaderWriter) and modify metadata value in ClientContext for each request sent on that stream? Also, on the server side, can i use the ServerContext of the incoming client stream, to send modified metadata value for each response sent back to the client on the bidiriectional stream. Please let me know if there is a way to do this since i dont want to maintain multiple streams for each of the metadata value. I would like to use same stream and send different metadata value for a key for each request/response exchanged on that bidirectional stream.
This is intentionally not supported.
Metadata is intended to be at the RPC layer per bidi stream; not per req/response. If you wish to communicate information per req/response, you should put that inside the req/response.
Metadata is intended to be for all req/response in the same stream.
Metadata is tied to stream; please see documentation https://github.com/grpc/grpc/blob/master/CONCEPTS.md#abstract-grpc-protocol
There is the client interceptor
https://github.com/grpc/grpc/blob/master/include/grpcpp/impl/codegen/client_interceptor.h
which may be able to help
These tests show examples how the interceptors can be used:
https://github.com/grpc/grpc/blob/master/test/cpp/end2end/client_interceptors_end2end_test.cc

Transform RPC-encoded message to MTOM in WSO2ESB

I'm facing this problem while working with WSO2 ESB:
I need to transform a RPC-encoded message which includes a byte array into a new MTOM-based message which contains the ID of that byte array and the binary file as an attachment.
I'd to know if there's any mediator in the ESB to accomplish this task or if I need to create my own procedure.
Thank you!
Maybe you should just copy binary data from source message binary field into a target message binary field and enable MTOM in the proxy QoS.
Let me now if if works.

Why last updated(null)

I created a pass and can register device to my server. I also updated this pass by changing some contents and insert a new row of pass to pass table. But why in console, last updated (null) ? this is what I get from console:
Apr 6 10:30:29 CamMobs-iPod4 passd[21] <Warning>: Get serial #s task (for device b6511c0dd47d04da449ce427b27fea74, pass type pass.cam-mob.passbookpasstest, last updated (null); with web service url http://192.168.1.202:8888/passesWebserver/) got response with code 200
Whenever a .pkpass bundle is accepted or replaced in a device's Passbook library, Passbook will tag the pass with a last updated attribute.
This attribute is typically set by the Last-Modified header a webserver sends the first time the pass is downloaded, and your web service sends with every response to the "Get Latest Version of a Pass" response.
Passbook also polls your web service using a "Getting the Serial Numbers for Passes Associated with a Device" method for serialNumbers, using the deviceLibraryIdentifier and passTypeIdentifier as criteria.
The "Getting the Serial Numbers for Passes Associated with a Device" response should contain a tag lastUpdated, indicating when the results of this query were last changed (I.e. when was the last time that a pass using the passTypeIdentifier registered to this deviceLibraryIdentifier was last updated).
However, the very first time Passbook sends a "Getting the Serial Numbers for Passes Associated with a Device", it will not have received a lastUpdated tag which is why it is showing null in your console log. Also, sending a lastUpdated tag is optional, so if it is not present, or if it is not sent correctly, then you will always see last updated (null) for this request.
You are free to use whatever you like as a lastUpdated tag. The simplest solution to implement is a unix timestamp as there is no need to mess around with date formats.

Can I use SSIS to submit a file

I've been asked if we can supply a file to a customer via web services. We uses Scribe a lot for sending data to web services but I can't send attachments. Anyone know if I could do something like this with SSIS (or another tool):
This is a method that a client uses to upload purl updates. This is a single file that is uploaded in a CSV format with the first row being the header.
The method expects five (5) parameters:
Parameters (1) a string that is the login name.
Parameters (2) a string that is used for the password.
Parameters (3) a string that is used to specify which application.
Parameters (4) a string that is the file name. This is used to identify a specific file upload.
Parameters (5) an array of bytes that is the content of the file.
Parameters (6) an integer that defines the length of the file upload.
RETURNS an integer that will return the number of items successful uploaded or a negative number that returns an error.
Sample:
// Connect to the Web Service
PurlService.ServiceFile service = new PurlService.ServiceFile();
// Test the method
string login = “mylogin”;
string password = “mypassword”;
string application = “FSI”;
string filename = “myfilename.csv”;
byte [] bytes = new byte[file.ContentLength];
file.InputStream.Read( bytes, 0, file.ContentLength)
int returnValue = service.UploadFile(login, password, application, fileName, bytes, bytes.Length ); // If successful, the returnValue will be a text message.
SSIS provides access to the .NET libraries so if you can write it in a console app, you can do it in SSIS (I have an SSIS package that plays MP3s just to prove this point). The Script Task is how you will want to make your web service call. There is a built-in web service task but it's crap. The above code looks vaguely correct for a web service call although mine are all Windows Auth so I set credentials differently.
Workflow-wise, I'd expect your package to look something like a Data Flow to generate your CSV extract and then a Script Task to call your web service and then possibly a file task to archive the CSV or an Execute SQL Task to record the transmission details in a table.

BizTalk Send Flat File to Web Service

I currently have a BizTalk 2006 (r1) application which receives XML from a SQL stored proc using the SQL adapter. It maps this to another schema before sending out to a 3rd party. The send port uses a custom pipeline component which converts the XML to a flat file - in the format required by the customer. I don't use any orchestration, this is a pure message based solution.
This all works great when sending via FTP. However, the 3rd party have now requested that I push the message to a web service they hosy. I haven't received the WSDL yet but can assume that the method I'll be calling simply receives a string as a single parameter.
Could anyone advise on the best way to approach this please? I have created a simple web service stub. I then followed Recipe 6-11 from the excellent BizTalk 2006 Recipes book, generating a proxy class using wsdl.exe which I then reference from the "web service" tab of the SOAP send port. However, when processing an order I get the following message in the event log:
Could not load type 'WSProxy' from assembly 'Direct.IS.Payment.Components, Version=3.1.145.0, Culture=neutral, PublicKeyToken=dc03da781bea1472'.".
The type must derive from System.Web.Services.Protocols.SoapHttpClientProtocol.
The type must have the attribute System.Web.Services.WebServiceBindingAttribute. ".
Next step will be for me to play around with the proxy so that it address the derive and attribute issues mentioned in the even log message. However, I can't help but think that there must be an easier way?
Thanks
The custom pipeline component you have created is not producing a message that is suitable for SOAP transmission. Not knowing what the end customer is going to do, I'd hold off on trying ot make SOAP work. In the mean time, just spin up an ASPX page with the following code:
private void Page_Load(object sender, EventArgs e)
{
StreamReader reader = new StreamReader(page.Request.InputStream);
String xmlData = reader.ReadToEnd();
}
Add code to write XMLData to a DB or to a text file or something to see what it is. This is very crude and does not send a response code. It should get you started.