Sunday, May 16, 2010

Dynamics AX 2009 AIF - Error Access to Service

Last week, I was involved in creating a custom webservice using AIF (Dynamics AX 2009). Last time when I worked on AIF development, that was with AX 4.0 ,which then had the limitations for update operation and which got resolved in one of the service pack released later.

I created this custom query and then ran the AxD Wizard inorder to generate my custom services. The service got created successfully which I had to consume in my .Net test harness application ( a simple .Net Windows client app to test my service by passing the required parameters). As expected, my first attempt never works without giving me an error ;-), I spent some time digging into this checking in Windows Event Viewer and .Net Stack Trace without any luck. Later on, it striked me to go and check into the Exception raised in AIF in AX.

I navigated to Basic => Periodic => Application Integration Framework => Exceptions and got this error description "The User does not have access to the service" though it was not a proper descriptive one, it gave me some insights where to debug..

I put the breakpoint in the below class AifRequestProcessor (verifyRequestIsAllowed method) and found the actual issue was that the new service created by me does not have a security key assigned to it. Once the Security key was assigned this helped in resolving the error.

Thought posting some AIF links/blogs which might be useful ..

Troubleshoot AIF 
http://technet.microsoft.com/en-us/library/aa548693.aspx




Consuming AIF Web Service is VS 2008 http://www.eggheadcafe.com/software/aspnet/33917648/consuming-aif-web-service.aspx



AIF Error Access to Service https://community.dynamics.com/forums/t/18134.aspx



Dynamics AX - AIF WebService for AxdSales Order http://paruvella.spaces.live.com/Blog/cns!F2EC589E221A4DB0!133.entry



How to: Call an AIF Web Service from C# http://msdn.microsoft.com/en-US/library/cc652581(v=AX.50).aspx



AIF Integration using web services https://community.dynamics.com/forums/p/30337/59298.aspx



AIF Find/Read in Dynamics AX https://community.dynamics.com/blogs/axsantoshr/comments/51105.aspx



Dynamics AX integration using AIF http://blogs.msdn.com/aif/



Creating Custom Dynamics AX Services http://blogs.msdn.com/aif/archive/2008/12/16/creating-custom-dynamics-ax-services.aspx

4 comments:

  1. Exactly my issue. Thanks.

    ReplyDelete
  2. Exactly my issue. Thanks!

    ReplyDelete
  3. Exactly my issue. Thanks!

    ReplyDelete
  4. Even after selecting the security key I'm getting the same error. I'm also using the security key in other services which I'm able to access. any ideas?

    ReplyDelete