Les produits et services pour la province de Québec, Canada se trouvent à http://www.drupont.com.
QuébecLes produits et services pour la province de Québec, Canada se trouvent à http://www.drupont.com. |
Accessing the AIRS Web Service using OLE/COM via VB.NetThe challenge was to connect to the Canadian Food Inspection Agency's (CFIA) Automated Import Reference System (AIRS) Validation Web Service from a basic scripting language (such as Revelations's OpenInsight). CFIA does not permit access via HTTP GET or POST while SOAP generates byte array data types for the XML content that the scripting language does not support.
We elected to use Visual Studio 2008's built-in functions to perform the byte-string data conversions and generate the SOAP interface. We also used Interop to make the properties and methods accessible via COM/OLE from the script. A setup project was created to generate the install package that automatically registered the COM objects on the client machine. All project documents are available on the AIRS download page Terms of useThese resources and information are provided as freeware. Please provide a link back to this page (http://www.exorsys.com/AIRS) if you find this useful. SpecificationsThe AIRSGateway project accepts all standard AIRS web service input parameters as properties and returns all available AIRS web service results as properties, substituting BYTE data types with STRING.
The GetResponse method returns a boolean response that evaluates to true (-1) when a successful web service call has been effected. Otherwise it returns zero with the Soap exception information in the "Error" properties.
Input properties
Output Properties
Download the complete AIRS Web Service Specifications Create the project
Prepare the main class module
Reference the AIRS Web Service
Call the Web ServiceCreate the method "GetResponse" to be used by the calling script by adding the following lines immediately before the "End Class" statement. This uses the dotNet GetBytes and GetString functions to convert to/from the Byte Array data type which is generated by the Web Service WSDL and is not supported by the scripting environment. Generate the COM interface
Test the dotNet projectCreate a simple Windows forms application that references the AIRSValidation project and executes the following code; Test the COM interfaceThe following OpenInsight program demonstrates how the generated COM object can be accessed from a simple script Creating the Windows Installer Setup PackageWhile the AIRSGateway project is open in VS;
To access all project resources and results: view the AIRS download page.
|
Search |