I have a remote machine with AX2012 installed and in it I have built a custom service in AX2012 and I am able to use it properly in a windows console application (VS2010). But when I try to connect to the service from my own machine through a windows console application (VS2012) , it gives me the error "The server has rejected the 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" in the app.config I get the following error "The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9609696'"
This same thing works perfectly on the remote machine but does not work on my machine. How do I proceed?