I have a remote machine with AX2012 installed, and in it I created a user service in AX2012, and I can use it correctly in the Windows console application (VS2010). But when I try to connect to the service from my own machine through the Windows console application (VS2012), it gives me the error "Server rejected client credentials."
My code is as follows:
ServiceReference1.TestService1Client t = new ServiceReference1.TestService1Client(); t.ClientCredentials.UserName.UserName = "vanya"; t.ClientCredentials.UserName.Password = "*******"; t.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; ServiceReference1.CallContext c = new ServiceReference1.CallContext(); c.Company = "ussi"; ServiceReference1.EventList eventss = t.getEventItems(c, "BradPSUS", "contoso.com");
The binding in my app.config is as follows:
<bindings> <netTcpBinding> <binding name="NetTcpBinding_TestService1" transferMode="Buffered" /> <binding name="NetTcpBinding_ItemService" /> </netTcpBinding> </bindings>
If I add security mode = "none" to app.config, I get the following error: "The socket connection was interrupted. This may be due to an error processing your message or the reception time-out by the remote host or the main network resource. The local time- socket out was "00: 00: 59.9609696" "
The same thing works fine on a remote machine, but does not work on my machine. How can I continue?
source share