- .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)
A unique number to identify log agent within Integration Manager.
The name of the Endpoint which then can be used within Integration Manager to search for events & messages logged with this COM object.
The direction of this Endpoint, this can either be “Receive” or “Send”.
A unique URI to identify from which address this Endpoint is logging, for example a file path / service address, and so on.
The original messagetype used before Integration Manager processes it.
The name of the machine on which you log events/messages.
The name of the process/application which logs events/messages.
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)
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!
- 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")
If everything worked as it should you should see a Message Box displaying "Successfully logged event/message to IM".
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
|Log2IM_v10()||Empty constructor initializing the object.
||Sets the path to the application config that should be used within the created instance of the object.
, int logAgentId
, string endPointName
, string endPointDirection
, string endPointUri
, string originalMessageType
, string processingMachineName
, string processName
, int logStatusCode
, string logText)
|Logs an event to Integration Manager.
, 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!
, string value)
|Adds a context value to the event that has been logged.