Hi,
I'm trying to consume a custom AIF service in C#.
Firstly I create Service and Service Group in AX 2012, then I deployed with HTTP Adapter and basicHttpBinding set to "None". In the IIS I set the authentication to Anonymous and Basic Authentication.
Then I create small C# console application to try consume the service.
Below is the snippet of the code:
CallContext context = new CallContext();
ServiceClient client = new ServiceClient();
client.ChannelFactory.Credentials.UserName.UserName = @"user";
client.ChannelFactory.Credentials.UserName.Password = @"password";
client.getUser(context, "user");
When I try to run the code, the application always throw an exception:
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll
And when I check the event viewer, it have some errors:
The logon user could not be determined. An exception will be thrown: The request could not be authenticated.
The received message has no security context.
I have try to find the solution but still can't find one. Does anyone have any solution for this problem?
Thank you in advance.