Having a hard time with Dynamics AX 2012 R3 and the business connector. I have set it up according to what Microsoft specify. They also provide some code to test the connector.
Below is a snippet
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Dynamics.BusinessConnectorNet;
namespace LogOnAsExample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Create an instance of the Axapta class.
Axapta DynAx = new Axapta();
// Add the proxy user.
// Replace the ProxyUserID and password parameters with the
// proxy user name and password that you specified
// in the Business Connector Proxy.
System.Net.NetworkCredential nc = new System.Net.NetworkCredential("axproxy", "password", "");
string strUserName = "axproxy";
// Test the connection to the .NET Business Connector.
try
{
DynAx.LogonAs(strUserName.Trim(), "actron.com.au", nc, "", "", "", "");
MessageBox.Show("Success");
DynAx.Logoff();
MessageBox.Show("Logoff completed.");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show(ex.Message);
}
}
}
}
When I click run on the program and test it, I get this error;
If I create this user as a user in AX then I get a successful connection. Can't work out why the actual connector won't work.