MIEWebServices Support Module

<< Click to Display Table of Contents >>

Navigation:  General Functions > Configuring the MIE (Programmer's Guide) > Calling Web Services >

MIEWebServices Support Module

The MIEWebServices support module (miewebservices.dll) is used to handle some of the ESI-specific calls needed to prepare data for passing to the web services that use the Generic Calling Sequence, as well as prepare data for use once it has been returned by the web service method.  Data passed to the web service must be run through ESI's compression/scrambling algorithm and optionally run through ESI's 3DES encryption (and likewise, the reverse must be performed on data returned).  Additionally, data passed to web services is passed in the form of a .net dataset, with one table and one row of information.  The columns passed in that one row represent the various parameters.  MIEWebServices contains methods that assist in forming the dataset that is passed (in addition to compressing/scrambling and uncompressing/unscrambling).

 

Instantiating MIEWebServices

The following code example shows how to create an instance of MIEWebServices in your code module:

              Dim oM As New MIEWebServices.MIEWebServices

 

Properties

Property

Type

Definition

ByteIn

Byte array, Write Only

Required by certain methods prior to calling the method.  For passing a byte array to a method that requires a byte array.  This property must be set prior to calling the method.

ByteOut

Byte array, Read Only

If the method returns a byte array, this property will contain the  array once the method has successfully completed.

DSin

Dataset, Write Only

Required by certain methods prior to calling the method.  For passing a dataset to a method that requires a dataset.  This property must be set prior to calling the method.

DSout

Dataset, Read Only

If the method returns a dataset, this property will contain the dataset once the method has successfully completed.

Encrypt

Boolean

If set to true, the contents of anything in the ByteIn property are expected to be 3DES encrypted via ESI's encryption algorithm.  Anything deposited in the ByteOut property will likewise be encrypted.  If set to false, no encryption/decryption will take place.

ErrorCount

Integer, Read Only

The number of errors encountered when the most recent method was invoked.

FieldDefinitions

FieldDefs structure array

This is an array, of type FieldDefs (a structure of MIEWebServices) that is used to pass field definitions to various methods (mainly used to create data tables).  This property must be set prior to invoking any method that requires this property as input.

IssueCount

Integer, Read Only

The number of issues encountered when the most recent method was invoked.

Message

String, Read Only

If an errors were encountered by the last method, this property will be populated with an explanation of the error(s) encountered.

TableName

String

The name of the table to be created (applies to some methods).  This property must be populated prior to calling any methods that expect this value as input.

Version

String, Read Only

The version of MIEWebServices in use.

 

Methods

Note:  When calling a method that uses properties for inputs/outputs, first populate any properties it expects as inputs.  Your return values will be available as properties upon successful completion of the method.  Always check the ErrorCount property after each method to be sure no errors were encountered.

Method

Input(s)

Output(s)

Definition

CRYPT

Action - D for decrypt, E for encrypt

Src - Source string to be encrypted or decrypted

Encrypted or decrypted (depending on action requested) string.

ESI's single variable encryption/decryption algorithm.  This is different from ESI's 3DES encryption/decryption algorithm (which is typically used to encrypt/decrypt entire datasets).  This algorithm is most often used to encrypt passwords before they are sent to the web services.  This method does not use properties - parameters are passed as part of the call to the method and the method returns the string value directly.

DecompressXMLDataset

ByteIn - Byte array property must be populated before invoking this method.  Contains the byte array returned by the MIE web service

DSout - Property is populated with the recovered dataset that contains the information returned by the MIE web service.

Data returned by the MIE web services is in the form of a byte array.  The byte array represents a compressed/scrambled and optionally encrypted dataset.  This routine is called to turn the byte array returned by the MIE web services into a .net dataset that can be used by your program.

MakeCallingDataSet

Encrypt - Must be set prior to calling the method.

TableName - name of table to create in dataset.

FieldDefinitions - definitions of the various columns to be created in the table contained in the returned dataset.  Each column is a different parameter to be passed and is dependent on the web service method being called.

Dataset (returns a dataset directly, does not populate the DSout property)

Data sent to the MIE web services is expected to be in the form of a dataset.  The dataset contains one table and the table contains one row.  The row has a number of columns, the names and types of each are determined by the web service being called.  This routine creates the dataset as a first step in preparing data to be passed to the MIE web services.  It returns the dataset with one table and no rows populated.  The table will have its columns set based on the FieldDefinitions passed.  The next step after creating the dataset is to populate the row with values, and then to compress and optionally encrypt the dataset (handled by another method).

ReturnCompressedDatasetXML

Encrypt - defines whether the returned byte array will be encrypted.  

DSin - the populated dataset to be compressed and optionally encrypted.

ByteOut - populates this property with the byte array the represents the compressed and optionally encrypted dataset.

Parameter data sent to the MIE web services is expected to be in the form of a byte array that represents a compressed and optionally encrypted dataset.  This method takes the fully populated dataset that is ready to be sent to the MIE web services, and performs the compression and optional encryption, as well as the conversion to a byte array.  The output byte array from this method is used as an input to the MIE web services GenericCall.aByte() element.

SetIntegerField

f - (By reference) structure of type FieldDefs

fName - Name of column (string)

bUnique - True if column must be unique (Boolean)

f - the referenced structure sent is updated with the necessary field definition information for creating an integer column.

This routine simplifies the creation of column definitions used by MakeCallingDataset.  A call is made for each column definition to be created.  A column is created for each parameter to be passed to the MIE web service method.  The column types and names are dependent on the web service being called (refer to the web service help for the columns required).

SetStringField

f - (By reference) structure of type FieldDefs

fName - Name of column (string)

fLen - Maximum length of the column (integer)

bUnique - True if column must be unique (Boolean)

f - the referenced structure sent is updated with the necessary field definition information for creating a string column.

This routine simplifies the creation of column definitions used by MakeCallingDataset.  A call is made for each column definition to be created.  A column is created for each parameter to be passed to the MIE web service method.  The column types and names are dependent on the web service being called (refer to the web service help for the columns required).