Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Consuming AX AIF Service

$
0
0

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.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>