Software Requirements
- .NET Framework 4.0
- 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.
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
- Create a file and name it HelloWorld.vbs
- 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")
Save HelloWorld.vbs
Execute HelloWorld.vbs
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:
|
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:
|
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:
|
AddContextValue(
string key , string value) |
Adds a context value to the event that has been logged.
Parameters:
|