How to open ax in different remote environment from C# Code ?

I am trying to open an Ax instance using C# in a different RDP Environment(Remote Desktop) to read labels from AOT using Logon(Company,Language,Object Server,Configuration) ,but to no success till now.

Does anybody know how to go about this problem ?

The code is given below.

class Program

{

[

STAThread]

static void Main(string[] args)

{

Axaptaax;

stringAxConfig;

string sID = “@SYS21669”;

objecto;

boolb;

AxConfig =

@“TST2_USR”;

try

{

// Login to Microsoft Dynamics Ax.

ax =

new Axapta();

ax.Logon(“xyz”, “en-us”,“V1-SDAX-02”,AxConfig);

}

catch (Exception e)

{

Console.WriteLine(“An error occurred in object creation or Axapta logon: {0}”, e.Message);

return;

}

// Logon was successful.

try

{

// Call a static class method.

// In this example, call SysLabel::labelId2String2

// to determine the label string for a particular label ID.

o = ax.CallStaticClassMethod(

“SysLabel”, “labelId2String2” , sID);

}

catch (Exceptione)

{

Console.WriteLine(“An error has been encountered during CallStaticClassMethod: {0}”,e.Message);

b = ax.Logoff();

return;

}

// Display the returned string.

Console.WriteLine(“The label string for {0} is {1}.”, sID, o.ToString());

Console.WriteLine(“Press any key to continue.”);

Console.ReadLine();

// Log off from Microsoft Dynamics AX.

b = ax.Logoff();

What’s the problem? Do you get any error? Does it work with the default configuration (all parameters set to null)? What’s your version of AX?