Posted on behalf of Marianne Soucy, Manager of Client Education Services
What is a webservice?
- A webservice is a way to, unattended, interact with a web based receiver of information.
- It communicates from one machine to another, with the expectation that a user is not sitting at the screen supplying information (like a user would be with a regular website)
- A webservice is a collection of open protocols that are designed to allow different technologies to interact and supply and receive information, ie to exchange data.
What terms do I need to know?
- There are several common terms you should understand when discussing a web service
- XML – a web service uses XML to tag data, in order to put all the needed data into a universal, commonly agreed upon format between the systems that are communicating. XML can tag each field of data to label it, making it a good choice to pass the data between systems.
- SOAP – Simple Object Access Protocol – a protocol for sending and receiving messages between applications. Consider it something like wrapping a message in an envelope. It allows us to deliver the message via defined protocols.
- Probably 80% or more of the interfaces we are seeing in Healthcare use SOAP transmission
- JSON – JavaScript Object Notation – another open standard format that allows transmission of messages. Another form of “Envelope”.
- Maybe 10% of what we are seeing in the field is JSON
- WSDL – Web Service Description Language – a document that describes a web service (kind of like an HL7 spec) and tells you how to access and use its methods. This document gives you a blueprint on what the web service will need for you to interact with it.
- FHIR – (Fast Healthcare Interoperability Resources) another emerging technology we anticipate will change the above ratios Technically, FHIR is designed for the web; the resources are based on simple XML or JSON structures, with an http-based RESTful protocol where each resource has predictable URL.
What information will I need to know to set up a Web Service in Healthcare?
- The URL of the webservice
- The URL of the WSDL is also useful. Often, that can be found by taking the URL above and placing ?WSDL after the .asmx in the URL for example:
- http://www.webservicex.com/globalweather.asmx = the URL you will send to
- http://www.webservicex.com/globalweather.asmx?WSDL is often the WSDL that will give you the specifications of what the service is going to be looking for, what strings and parameters it is using, etc.
- Not all Web Services will give you a WSDL, but it makes setting things up WAY easier!
- Do I need a certificate
- Do I need a username and password
- What parameter(s) does this web service expect me to supply to them
- The URL of the WSDL is also useful. Often, that can be found by taking the URL above and placing ?WSDL after the .asmx in the URL for example:
LINK for a good explanation of this :
http://www.webreference.com/authoring/web_service/index.html
How do I check out a Webservice I want to set up?
We are going to use a simple example, showing how to get a Webservice to give us back the weather for a city and country.
- First, we are going to test the URL to see if it is present and working.
- Open Internet Explorer and plug in the URL of the Webservice like shown:
- http://www.webservicex.com/globalweather.asmx
- Click GetWeather and put in Madrid and Spain (this doesn’t work for all countries, please do use Madrid)
- In theory, this is what we want our fake web service to do. We want to give it 2 parameters, and for it to give us back an answer
- In an interface engine, we would be giving them something, like an HL7 message, or a patient ID and a test code result, and they would be giving us back an ACK, in real life terms.
- Next, we are going to test the WSDL to see if it is present and working.
- Open a new tab and type : http://www.webservicex.com/globalweather.asmx?WSDL
- This should give you back a schema, a specification explaining what it needs and wants.
- This tells me that the MethodName I need to pass will be GetWeather, and that it will expect TWO parameters, a CityName and a Country Name.
- Many interface engines, such as Express Connect, will make this easy in a wizard later!!
Image may be NSFW.
Clik here to view.
- For less simple examples, we need to consider the following:
- Do we need to install a certificate?
- Do we need a username and password?
- Let’s install a certificate:
- This is a website that needs a certificate. I can install it this way – click the LOCK icon in the IE browser. Click View Certificates
Image may be NSFW.
Clik here to view.
- Click INSTALL CERTIFICATE
Image may be NSFW.
Clik here to view.
- Browse and put it in the PERSONAL STORE of the user – Or as directed by your vendor as to where to put it.
Image may be NSFW.
Clik here to view.
SOURCE INFO and useful links:
Some generic web services to play with :
http://www.webservicex.net/ws/default.aspx – click the name of any web service, I use the GeoIPService one to test a simple pass of one parameter.
This is what a WSDL looks like : http://www.webservicex.net/WeatherForecast.asmx?wsdl
Info on Web Services: http://www.webreference.com/authoring/web_service/index.html
Microsoft HL7 Web Services info: https://msdn.microsoft.com/en-us/library/ms954603.aspx
The main things to remember about a WSDL file are that it provides you with:
- A description of a Web service
- The methods a Web service uses and the parameters that it takes
- A way to locate Web services