web stats
REST Webservice - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 02-20-2014, 09:50 AM
santosam santosam is offline
OBX.2 Kenobi
 
Join Date: May 2012
Location: Portugal
Posts: 62
santosam is on a distinguished road
Default REST Webservice

Hi all,
this is an example of how a REST webservice can be implemented in Mirth Connect 3.

Notes:
1. The credentials are stored in an array. Others options are possible.
2. There is only one destination. Another option is to use several destinations for each operation

Happy to answer your questions!

Alex

NOTE: The XML channel is updated to version 1.1.0
Attached Files
File Type: xml REST Example.xml (32.6 KB, 189 views)

Last edited by santosam; 02-22-2014 at 01:27 AM. Reason: New file available
Reply With Quote
  #2  
Old 02-21-2014, 11:07 AM
mtod mtod is offline
OBX.2 Kenobi
 
Join Date: Aug 2013
Posts: 57
mtod is on a distinguished road
Default

So I'm struggling a bit on how your passing the UserID and Password to the REST service.

I'm using SoapUI to test this and when I add the UserID / PW to the properties it does seem to work.

Thanks

Mike
Reply With Quote
  #3  
Old 02-21-2014, 12:15 PM
santosam santosam is offline
OBX.2 Kenobi
 
Join Date: May 2012
Location: Portugal
Posts: 62
santosam is on a distinguished road
Default

You can use Postman on Google Chrome also, it's simpler. You have to use Basic Auth to pass those headers.

Alex
Reply With Quote
  #4  
Old 02-21-2014, 12:26 PM
mtod mtod is offline
OBX.2 Kenobi
 
Join Date: Aug 2013
Posts: 57
mtod is on a distinguished road
Default

Ok figured it out SoupUI requires you to set the HTTP global Settings (Authenticate Preemptively Add to true)

Work fine now.

Thanks for the sample.
Reply With Quote
  #5  
Old 02-21-2014, 02:25 PM
mtod mtod is offline
OBX.2 Kenobi
 
Join Date: Aug 2013
Posts: 57
mtod is on a distinguished road
Default

I tried both SoapUI and Postman and I get connected and rec an OK back. It appears to execute the script but no response value to the client.

Any idea what would cause that?

Thanks

Mike
Reply With Quote
  #6  
Old 02-22-2014, 01:18 AM
santosam santosam is offline
OBX.2 Kenobi
 
Join Date: May 2012
Location: Portugal
Posts: 62
santosam is on a distinguished road
Default

Try this URL: localhost:8890/country/US

If the country you choose isn't listed in the array it returns nothing with OK.
Reply With Quote
  #7  
Old 02-22-2014, 01:29 AM
santosam santosam is offline
OBX.2 Kenobi
 
Join Date: May 2012
Location: Portugal
Posts: 62
santosam is on a distinguished road
Default

There is a new XML available.

Changelog: if the return of the service is a blank array, then it return Error 500 and :
Code:
{
    "name": "404",
    "message": "Not Found."
}
Reply With Quote
Reply

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 05:03 PM.


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