Dynamics AIF : Tracing Web Service calls

When using AIF through web services, you can be in the dark when you want to know what’s really going on in there. Additionally you can have trouble debugging the thing when you are running a Windows 2008 box. (Contacted Microsoft last week and the response was that debuggin AIF webservices does not work on a Win2k8 box but they are developing a hotfix as we speak)

There is a possibility to have some tracing of what is happening there.  I found this on MSDN and will show an example here of what the result of the tracing shows. 

First, head over to the folder where the Dynamics Ax web services are generated. There you should find a web.config file. To enable tracing you need to make sure this tag is present 

 <system.diagnostics>
    <!-- This is used for enabling tracing in retail and debug builds.
           AIF Service processing stack outputs and information
           messages used for debugging.
           Possible values for the switch are Off, Warning,
             Information, Critical, Verbose.
           Change the switchValue to Information to enable tracing.
      -->
    <sources >
      <source name="AifServiceProcessing" switchValue="Information">
        <listeners >
          <add name="TextWriterListener"
               type="System.Diagnostics.TextWriterTraceListener"
               initializeData="AifServiceTrace.webinfo" >
          </add>
          <remove name="Default" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>  

After invoking the service, there should be a file named AifServiceTrace.Webinfo present with the tracing information : 

The following information can be viewed :

  • UserId’s
  • Message ID
  • Source and destination endpoint
  • Key Data XML
  • Return Data from Ax

 

AIF WCF Tracing

2 thoughts on “Dynamics AIF : Tracing Web Service calls

  1. Is this tracing of AIF still working in Dynamics 2012? If so, are there addtional steps needed to get it working?

  2. Hi charles,

    With Dynamics AX2012 services, the same type of logging can be done with WCF configuration.
    You can go to the Inbound port, deactivate the port and then the configure button should be active. When you click configure (and have the Windows SDK installed on your machine) the WCF configuration tool should appear.

    There you can navigate to the diagnostics and enable tracing there.
    The following two links might help you out with this:

    http://msdn.microsoft.com/en-us/library/ms732009.aspx (Enable WCF logging part)
    http://www.codeproject.com/Articles/383162/Logging-and-Tracing-WCF-Soap-Messages

    regards,
    Kenny

Leave a Comment Yourself

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>