ipMonitor 7.x Soap Sample: ConvertMonAddress
Sample Description:
The ConvertMonAddress sample is a .Net Windows Form project written with C# that uses SOAP to communicate with an ipMonitor 7.x instance in order to demonstrate how to change configuration settings through SOAP.

This sample demonstrates how 3rd party applications can interact with ipMonitor in order to view and edit configuration elements such as monitors. Other applications may be created to perform many other tasks.

The different configuration elements manageable through SOAP are monitors, groups, alerts, maintenance profiles and reports. The ipMonitor SOAP interface allows for adding, editing, viewing and deleting these configuration elements. Each item is represented in XML format within ipMonitor. An option on the top menu of the ipMonitor interface allows you to popup XML while editing a configuration item such as a monitor. Viewing the XML will allow you to gain a better understanding of the format of the configuration elements.

With this sample, you can:
  • Log in to ipMonitor 7 through SOAP in a .Net Windows Form C# application.
  • Optionally use SSL.
  • Convert IP Addresses for monitors to Domain Names and back.
ipMonitor 7 SOAP Methods Used (C#):
Project Discussion:

  • For simplicity, this project consists of two forms which contain all the application logic.

  1. The application first starts with a login screen. It then asks for connection properties and ipMonitor Username and Password.
  2. If Using SSL, the certificate must not return errors such as incorrect common name.
  3. Monitors whose Domain names or IP Addresses can not be resolved do not show in the selectable list. Due to the timeout length of GetHostByAdress functions, this sample may slow down considerably if there are many unresolvable IP Addresses.
  4. Monitor configuration is stored as XML. XPATH and regular expressions are used to locate requested attributes.

Our goal for this project is to showcase how to make configuration changes in ipMonitor through SOAP using a .Net Windows Form Application written in C#. The first form in the project demonstrates how to connect to the ipMonitor 7 server.

Once logged in, the following window will appear. This form displays monitors whose addresses may be converted between the IP Address and Domain name. Select the monitors to be converted and click on Go. The application will make the necessary changes to the monitors' XML and return the changes via SOAP.

SOAP Sample Breakdown, by file:

The C# project that contains everything needed to compile the Windows Form C# application. Note: you will likely have to change the webinfo file to correspond to the location of centralstatus.csproj.

The Window Form implementing the login logic.

The applications' Main Windows Form. This form contains all the application logic once logged in. The application performs a SOAP request to retrieve all the monitor configuration objects in XML. The code then filters the monitors depending on whether they use IP Addresses or Domain Names. Clicking the Go button causes the changes to be made on the ipMonitor server.

Object for storing the connection settings used by application.

.Net Xml resource file.

.Net Xml resource file.

The project references.

The applications icon.

.Net assembly info file.

Windows Application configuration file.