Microsoft Dynmaics 2012 - Business Connector Setup Issue

by long   Last Updated July 12, 2019 08:01 AM

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;

1

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.



Related Questions


Updated December 02, 2015 01:00 AM

Updated May 10, 2016 09:00 AM

Updated December 29, 2017 17:01 PM

Updated November 29, 2017 19:01 PM

Updated May 17, 2018 11:01 AM