Software Requirements

  • .NET Framework 4.0
Installation
  • Start the installation of Integration Manager COM Wrapper by executing “IM.IntegrationManager.COM.Wrapper.Install.msi”
  • The installation will install the needed files into the following folder “C:\Program Files (x86)\Integration Manager COM Wrapper\”. 
  • Use GacUtil to import DLL into GAC
  • Use Regasm to register DLL In Registry.
You have now successfully installed Integration Manager’s COM Wrapper which enables you to log messages in e.g. VB6.


Settings / App.Config

To change settings open “IS.IntegrationManager.Com.Wrapper.Library.v1.0.dll.config” located inside the installed folder.


Application Settings (AppSettings)

  • LogAgentId
    A unique number to identify log agent within Integration Manager.
  • EndPointName
    The name of the Endpoint which then can be used within Integration Manager to search for events & messages logged with this COM object.
  • EndPointDirection
    The direction of this Endpoint, this can either be “Receive” or “Send”.
  • EndPointUri
    A unique URI to identify from which address this Endpoint is logging, for example a file path / service address, and so on.
  • OriginalMessageType
    The original messagetype used before Integration Manager processes it.
  • ProcessingMachineName
    The name of the machine on which you log events/messages.
  • ProcessName
    The name of the process/application which logs events/messages.


Service Settings


The service settings must be changed and pointed to correct LogAPI url. 


To change this setting, take a look at the URL of the installed LogAPI and copy it. Save it within the settings file in /Configuration/System.ServiceModel/client/endpoint[@address]. (See "Picture 1 - Log API Address" below)



(Picture 1 - Log API Address)


Usage

When Integration Manager’s COM Wrapper is installed example files are installed as well. You can find them within the Installed Folder under Examples.

The examples below require you to change app.config accordingly to your Environment – Especially the Service Settings!


Basic Tutorial

  1. Create a file and name it HelloWorld.vbs
  2. Copy and paste the following code snippet – you will find a description below the code snippet.

     

    Dim log2im
    
    Set log2im = CreateObject("IS.IntegrationManager.COM.Wrapper.Log2IM_v10")
    Call log2im.Set_AppConfig("C:\Program Files (x86)\Integration Manager COM wrapper\IS.IntegrationManager.Com.Wrapper.Library.v1.0.dll.config")
    Call log2im.LogEvent("Hello World", 10, "Log API COM", "Receive", "http://www.integrationsoftware.se/v1.0/logapi.svc", "Unparsed Interchange", "LocalDevServer", "TestApp", 0, "OK")
    
    Set log2im = Nothing
    
    MsgBox("Successfully logged event/message to IM")

     

  3. Save HelloWorld.vbs

  4. Execute HelloWorld.vbs

  5. If everything worked as it should you should see a Message Box displaying "Successfully logged event/message to IM".

Description

 

Dim log2im

 Creates an object called log2im.

 

Set log2im = CreateObject("IS.IntegrationManager.COM.Wrapper.Log2IM_v10")

 Sets log2im to the correct object type.

 

Call log2im.Set_AppConfig("C:\Program Files (x86)\Integration Manager COM wrapper\IS.IntegrationManager.Com.Wrapper.Library.v1.0.dll.config")

 Sets the path to the application config. This is very important to set due to the fact that the DLL is loaded from GAC and we need to specify the location of an application config.

 

Call log2im.LogEvent("Hello World", 10, "Log API COM", "Receive", "http://www.integrationsoftware.se/v1.0/logapi.svc", "Unparsed Interchange", "LocalDevServer", "TestApp", 0, "OK")

 Logs an event where the message’s body is “Hello World”, status 0 and logtext OK. For a detailed information about the parameters available in LogEvent see class documentation in section “Log2IM_v10 Class Documentation”.

 

Set log2im = Nothing

 Resets log2im to an empty object.

 

MsgBox("Successfully logged event/message to IM") 

 Displays a message box showing “Successfully logged event/message to IM.


Log2IM_v10 Class Documentation

Public Constructors

Name Description
Log2IM_v10() Empty constructor initializing the object.


Public Methods

Name Description
Set_AppConfig(string filePath)
Sets the path to the application config that should be used within the created instance of the object.

Parameters:
  • filePath:string 
    The full path to the application config. 
LogEvent(
  string body
, int logAgentId
, string endPointName
, string endPointDirection
, string endPointUri
, string originalMessageType
, string processingMachineName
, string processName
, int logStatusCode
, string logText)
Logs an event to Integration Manager.

Parameters:
  • body:string 
    The message’s body to log. 
  • logAgentId:int 
    The unique Id for Integration Manager to identify from which Log Agent the corresponding message has been logged. 
  • endPointName: string 
    The name of the EndPoint. 
  • endPointDirection:string 
    The direction of the EndPoint, this can either be “Receive” or “Send”, other values will result in “Receive” as default value. 
  • originalMessageType:string 
    The original message type name before Integration Manager processes the message. 
  • processingMachineName:string 
    The machine from which the event has been logged. 
  • processName:string
    The process that logs events/messages to Integration Manager. 
  • logStatusCode:int 
    The status of the event being logged. 
    If the status is 0: The event is marked as OK 
    If the status is below 0 (<0): The event is marked as an error event. 
    If the status is above 0 (>0): The event is marked as an information event. 
  • logText:string 
    A log text that explains for example what type of error occurred. This cannot be null, but can be empty: “” 
LogEvent_With_AppSettings(
  string body
, int statusCode
, string logText)

Logs an event to Integration Manager, but will use the appsettings in the application config file for settings such as EndPointName, -direction & -uri.
This requires all appsettings to be set up!

Parameters:
  • body:string 
    The message’s body to log. 
  • logStatusCode:int 
    The status of the event being logged. 
    If the status is 0: The event is marked as OK 
    If the status is below 0 (<0): The event is marked as an error event. 
    If the status is above 0 (>0): The event is marked as an information event. 
  • logText:string 
    A log text that explains for example what type of error occurred. This cannot be null, but can be empty: “” 
AddContextValue(
  string key
, string value)
Adds a context value to the event that has been logged.

Parameters:
  • key:string 
    The key of the context value. 
  • value:string 
    The value of the context value.