The documentation found on http://wiki.ca.com for CA MDM describes the API Services. This document describes and provides some sample code to connect using Visual Studio 2010 C# console application. This is provided as a sample only and is not supported.

On the initial connection, we have 3 possible endpoint connection types for each of the services that we are planning on using. Please take note of the naming convention here used for the service. The Service Name is embedded into the name as shown below. Note: "Server" after the capital "I":

WSHttpBinding_IServerService

NetTcpBinding_IServerService

NetNamedPipeBinding_IServerService

The next 3 lines of code set the domain, user and password for the credentials.

After the connection to the service is made, we can start making request calls to obtain the data.

First, we will initialize the context.

Server.ContextInfo myCtx1 = svc1.InitContext(_guid);

Next, let's get the Server and Farm ID

Server.ServerDescription[] tmp = svc1.GetServerList();

Server.ServerDescription _serverDesc = tmp[2];

string _myServerIDContext = _serverDesc.ServerId;

string _myFarmIDContext = myCtx1.FarmId;

Console.WriteLine("guid = " + _guid);

Console.WriteLine("_myServerIDContext = " + _myServerIDContext);

Console.WriteLine("_myFarmIDContext = " + _myFarmIDContext);

Get Tenant ID Context:

1- To look up the tenant ID manually, we can look at the database table: A_TENANT.

2- For the API Service, we will be making a call to the API service to retrieve the information. Note the code is very similar to what we used against the Server Service above.

TenantServer.TenantServiceClient svc2 =

new TenantServer.TenantServiceClient("NetNamedPipeBinding_ITenantService");