web stats
Webservice sender - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2018, 01:11 AM
shishirakram shishirakram is offline
What's HL7?
 
Join Date: Jun 2018
Posts: 3
shishirakram is on a distinguished road
Default Webservice sender

In my solution it is required to call a particular webservice multiple times and based on the response of the webservice further decision will be made. If I use the webservice sender to make web service calls, I've to have multiple destinations and that is not feasible my case as there will be too many web service invocations involved.

So I'm thinking of implementing the webservice sender in javascript writer.
But I don't know how to implement it in javascript, Kindly help me.

Mirth version - 3.6.1
I have to send 2-3 parameters also to the webservice.
Reply With Quote
  #2  
Old 11-30-2018, 09:50 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 561
agermano is on a distinguished road
Default

You can set up a second channel as a channel reader and web service sender. Your main channel can make multiple calls to it from a single destination using router.routeMessage
Reply With Quote
  #3  
Old 12-02-2018, 09:32 PM
shishirakram shishirakram is offline
What's HL7?
 
Join Date: Jun 2018
Posts: 3
shishirakram is on a distinguished road
Default

Ya that is one way...But creating a function/code template with javascript code to call the webservice would make the task much easier right...
Reply With Quote
  #4  
Old 12-03-2018, 07:04 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 561
agermano is on a distinguished road
Default

Doing it in javascript is probably a little more efficient, but takes more work to set up. And some people just don't like adding extra channels if they can do it themselves in javascript. It's really going to depend on your comfort level with java and javascript.

It's likely much easier to use a second channel that already implements a web server sender for you as a callable function. This is a perfectly acceptable use of a downstream channel, and should require little or no javascript.
Reply With Quote
Reply

Tags
custom webservice, javascript writer, webservice sender

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 04:21 AM.


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