To use the Microsoft C# programming language to develop your applications and the .NET version is 4.0 or earlier on the Mirage Server, you must perform certain tasks to set up a C# development environment.

Procedure

  1. Open Visual Studio Command Prompt and go to the dll directory.
  2. Run the command svcUtil Web.management.MirageApi.dll.

    By default, the file Web.Management.MirageApi.dll is located in C:\Program Files\Wanova\Mirage API\bin after you install Mirage.

  3. Run the command svcUtil *.wsdl *.xsd /o:MitService.cs.
  4. Add the generated MitService.cs to the C# project.

Results

With the generated client, you can login to Mirage API. For example:

ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
BasicHttpBinding binding = new BasicHttpBinding
{
    AllowCookies = true,
    Security =
    {
        Mode = BasicHttpSecurityMode.Transport
    }
};

//Connect to Mirage Web Management Server
EndpointAddress endpoint = new EndpointAddress(string.Format("https://<server-address>:7443/mirageapi/MitService.svc", address));
Client = new MitServiceClient(binding, endpoint);
Client.Login("<username>", "<password>");
Console.WriteLine("Login success!");

//Perform tasks