Microsoft Dynamics 365 Blog

For troubleshooting reasons sometimes is needed what exactly SOAP message is sent to AIF service. So we get a lot of questions how can we track such a message. The problem is not directly connected to Dynamics AX because using following method you can track every service included AIF Web service.

The easy way to get SOAP message can be:

1. Create C# client as described in:

2. Then add traces information to app.config created automatically for your application (as mentioned So my app.config look following:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>  <system.diagnostics>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" >
          <add name="xml"/>
      <source name="System.ServiceModel.MessageLogging">
          <add name="xml"/>
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\logs\Log.svclog" />
                <binding name="WSHttpBinding_SalesOrderService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            <extendedProtectionPolicy policyEnforcement="Never" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_SalesOrderService"
                contract="ServiceReferenceAIF.SalesOrderService" name="WSHttpBinding_SalesOrderService">
                    <userPrincipalName value="USER@domain" />
      <!– add trace logging –>
      <diagnostics wmiProviderEnabled="true">

3. Run C# program in C:\logs\ there will be file Log.svclog created

4. In C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin you can find SvcTraceViewer.exe you can just double click it to open then you can load the log created.

5. You will see all tracing information and also SOAP envelope


–author: Czesława Langowska
–editor: Czesława Langowska
–date: 06-12-2010

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!