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

Procedure

  1. Get the WSDL file MitService.wsdl from https://server-address:7443/mirageapi/MitService.svc?singleWsdl.
  2. Open Visual Studio Command Prompt and go to the wsdl file directory.
  3. Run the command Svcutil MitService.wsdl.

    Svcutil.exe is the ServiceModel Metadata Utility tool. This command generates a client.

  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