The BAM Interceptor for WCF does not come with a UI tool to create the Interceptor Configuration file, and from the Beta II customer feedback thus far, this is the main pain point as well.   I will try to provide some steps and guidelines to help ease this concern. 

 

A common scenario is when the WCF application configuration file is updated and the IC is created and deployed, there is not data intercepted and persisted into the BAM PITDB (Primary Import Tables Database).   When the event log is checked out without error and that the bm.exe deploy-interceptor is successful, most likely the culprit is in the IC – somewhere in the IC, the XPath is incorrectly set.

 

Here is what I would do:

 

Enable WCF logging/tracing to produce the wcf log.  In the config file of the “interceptee” application (either or both client and service), splice the following highlighted code.

 

<configuration>

  <system.serviceModel>

 

    <diagnostics>

      <messageLogging maxMessagesToLog="30000"

              logEntireMessage="true"

              logMessagesAtServiceLevel="true"

              logMalformedMessages="true"

              logMessagesAtTransportLevel="true">

      </messageLogging>

    </diagnostics>

 

  </system.serviceModel>

 

  <system.diagnostics>

 

    <sources>

      <source name="System.ServiceModel" switchValue="Verbose, ActivityTracing" >

        <listeners>

          <add name="xml" />

        </listeners>

      </source>

      <source name="System.ServiceModel.MessageLogging" switchValue="Verbose">

        <listeners>

          <add name="xml" />

        </listeners>

      </source>

      <source name="Microsoft BizTalk Bam Interceptors" switchValue="All" >

        <listeners>

          <add name="xml"/>

          <add name="myListener" type="System.Diagnostics.TextWriterTraceListener"

               initializeData="TextWriterOutput.log" />

        </listeners>

 

      </source>

 

    </sources>

 

    <sharedListeners>

      <add name="xml"

           type="System.Diagnostics.XmlWriterTraceListener"

           initializeData="Traces.e2e" />

    </sharedListeners>

    <trace autoflush="true" />

  </system.diagnostics>

</configuration>

 

 

Rerun the application.  This should generate a WCF trace file: *.e2e.

Use the SvcTraceViewer.exe tool (comes with WCF SDK installation) to view the wcf log and copy out the message into a .xml file.  

 

 

 

 

 Here in this snapshot of the tool, you should copy out the s:envelop node. 

 

Use and xpath tool (such as VisualXPath) to drill down to the specific area of the message to produce a valid XPath.  Copy and past this into the interceptor configuration file.

 

Redeploy the IC and rerun the application.

 

Hopefully the above steps would help surface the problematic XPaths in the IC and speed up your work.