다음을 통해 공유


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.

 

<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.

 

SvcTraceViewer1.JPG

Comments

  • Anonymous
    August 21, 2007
    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. Thanks Vidyakumar.naarumanchi MCTS-BizTalk 2006 vidyakumar.starex@gmail.com

  • Anonymous
    August 22, 2007
    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. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2040513&SiteID=1 Thanks, Keith