iNTERFACEWARE Products Manual > Learning Center > Tutorials and Sample Scenarios > Working With Plugins and Web Services > Calling Web Services from Iguana > Calling a Web Service from an Iguana Channel > Creating a VMD File To Call the Web Service |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Now that you have created the VMD file that processes incoming messages and extracts data from them, the next step is to create the VMD file that will call your web service and send it the data that you have extracted. To create this VMD file, perform the following steps:
This indicates that the message definition that you have just created will be used as the default if an incoming message does not match any other message definition. Since you will not be creating any other message definitions, this message definition will match all incoming messages.
Here, the value variable contains the contents of the incoming message. This script is needed because Chameleon normally expects all incoming messages to be in HL7 format. This means that all messages are expected to have MSH as their first segment. Since the messages that are being passed to this script are in XML format, the Global Inbound Script adds MSH to them to ensure that Chameleon will not flag them as containing errors. The next step is to create the transformation script that establishes a connection to a web service and sends the XML-formatted data to this web service. To do this:
The contents of the transformation script depend on the data that you are sending and on the web service that you want to call. However, all transformation scripts perform these tasks:
For example, suppose that you want to send extracted Patient ID, First Name and Last Name data to the SugarCRM web service. This web service keeps track of this information, which it then uses to generate possible leads for future opportunities. Here is a transformation script that can send this extracted data to your SugarCRM web service:
This script may seem very complicated, but it basically performs two tasks: it extracts the data from the incoming XML-format file, and it then sends the data to SugarCRM. The extraction process consists of the following steps:
After you have extracted the data and assigned it to PatientID, FirstName and LastName, the next task is to establish a connection to the SugarCRM web service and send the contents of these variables to this service. To do this, the script performs the following steps:
At this point, you are now ready to create the Iguana channels. These channels will use the VMD files to process incoming messages, extract the data, and send the extracted data to the SugarCRM web service. |