Announcements
Hi,
I have used customer service ,when i try to access the service operation getting the below error,
static void Main(string[] args)
{
ServiceReference1.CustomerServiceClient c1 = new ServiceReference1.CustomerServiceClient();
// ServiceReference1.CriteriaElement elem = new ServiceReference1.CriteriaElement();
ServiceReference1.QueryCriteria qr = new ServiceReference1.QueryCriteria();
CriteriaElement[] qe = { new CriteriaElement { } };
EntityKey[] entityKey = { new EntityKey { } };
qe[0].DataSourceName = "CustTable";
qe[0].FieldName = "AccountNum";
qe[0].Operator = Operator.Equal;
qe[0].Value1 = "xxxxxx";
qr.CriteriaElement = qe;
Bcn.Axapta axp;
axp = new Bcn.Axapta();
axp.Logon(null, null, null, null);
// c1.ChannelFactory.Credentials.UserName.UserName = "xxxxxt";
//c1.ChannelFactory.Credentials.UserName.Password = "xxxxxx";
entityKey = c1.findKeys(qr);------------------------>Getting error "You cannot log on to Microsoft Dynamics AX.. Error details: Failed to initialize Business connector.. Check the Web server event viewer for more information, or contact your Administrator."
if (null == entityKey)
{
}
else
{
c1.read(entityKey);
}
}
Hi Martin,
I got the below error message in event viewer,
Hi Martin,
I have captured the below error in the event log:,
The configuration xxxx-USR could not be found.
Use the Client configuration utility V5.0 to verify the configuration.
1) Remove this code; it has no useful effect.
2) Not apart from adding a service reference, which you already did. But don't forget all the other setup.
3) How you should configure WCF depends on how you want to use it. Note that there are two sides - client and server. If you change just one of them, they may be unable to communicate. I'm not sure, but I think your problem isn't caused by WCF authentication, but by the setup of BC.
It seems to me that you still didn't do what the error message told you and I reminded. Shouldn't you do it if you want to solve your problem?
Hi,
Please mention the bindings detail and end point configuration.
After getting the error in find keys , I placed business connector code.
1) Account is active.
2) Do we need to connect Aos server to vs?
3)I have used basichttpbinding,transport credential only, proxy credential type none.
First of all, let me format your code, to make it easier to read. Please make sure you use Insert > Insert Code (in the rich-formatting view) to paste source code in future.
static void Main(string[] args) { ServiceReference1.CustomerServiceClient c1 = new ServiceReference1.CustomerServiceClient(); ServiceReference1.QueryCriteria qr = new ServiceReference1.QueryCriteria(); CriteriaElement[] qe = { new CriteriaElement { } }; EntityKey[] entityKey = { new EntityKey { } }; qe[0].DataSourceName = "CustTable"; qe[0].FieldName = "AccountNum"; qe[0].Operator = Operator.Equal; qe[0].Value1 = "xxxxxx"; qr.CriteriaElement = qe; Bcn.Axapta axp; axp = new Bcn.Axapta(); axp.Logon(null, null, null, null); //c1.ChannelFactory.Credentials.UserName.UserName = "xxxxxt"; //c1.ChannelFactory.Credentials.UserName.Password = "xxxxxx"; entityKey = c1.findKeys(qr);------------------------>Getting error "You cannot log on to Microsoft Dynamics AX.. Error details: Failed to initialize Business connector.. Check the Web server event viewer for more information, or contact your Administrator." if (null == entityKey) { } else { c1.read(entityKey); } }
You're mixing web services and Business Connector. For example, you log into Business Connector but then don't use it for anything. It looks wrong to me.
Did you complete the setup? Is the Business Connectory Proxy account valid?
What did you find when you followed what the error message told you and checked event logs?
André Arnaud de Cal...
294,190
Super User 2025 Season 1
Martin Dráb
232,968
Most Valuable Professional
nmaenpaa
101,158
Moderator