Steps to facilitate the creation of WCF Interceptor Configuration file.

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.






      <messageLogging maxMessagesToLog=”30000″













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


          <add name=”xml” />



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


          <add name=”xml” />



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


          <add name=”xml”/>

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

               initializeData=”TextWriterOutput.log” />








      <add name=”xml”


           initializeData=”Traces.e2e” />


    <trace autoflush=”true” />





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.



Comments (2)

  1. Vidyakumar says:

    Hi Keith , i started working on BAM WCF Interceptor in BizTalk 2006R2, ur blogs helped me in understanding some concept behind WCF Interceptor and Interceptor Configuration File, but still i’m facing lots of problems in Creating Interceptor Configuration File for WCF and even i n the aread of WCF Adapte configuration to intercept the data…. so i’m requesting you to kindly send me any kind of material which helps me in understanding and also helps me in moving forward.

    I’m looking a complete approach from your end in this reard.

    Looking forward to here a positive reply from your end.



    MCTS-BizTalk 2006

  2. keithlim says:

    Hi Vidyakumar,

    I have reposted your question on this common site to get other input on this.  I will answer them as well later.  Also, it might already contain something that you want and you should post any further questions there.