Attention: We are retiring the ASP.NET Community Blogs. Learn more >

[WCF] Configuring the Service Client to Go Via TcpTrace

TcpTrace by Simon Fell is a great tool to trace your HTTP and SOAP calls with, until you begin using WCF and it starts complaining about you not going directly to the service, address filter mismatch and all that. It's quite easy to fix that though, just add an endpoint behavior to your client configuration and tell it your're running via TcpTrace, like this sample:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.serviceModel>

<bindings>

<wsHttpBinding>

<binding name="WSHttpBinding_IMyService" >

<security mode="Message">

<message clientCredentialType="Windows" />

</security>

</binding>

</wsHttpBinding>

</bindings>

   

<behaviors>

<endpointBehaviors>

<behavior name="tcpTraceBehavior">

<clientVia viaUri="http://localhost:8080/MessageSecurityWindows/Service.svc"/>

</behavior>

</endpointBehaviors>

</behaviors>

   

<client>

<endpoint address="http://localhost:1035/MessageSecurityWindows/Service.svc"

behaviorConfiguration="tcpTraceBehavior"

binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"

contract="MessageSecurityWindowsClient.MyService.IMyService"

name="WSHttpBinding_IMyService">

</endpoint>

</client>

</system.serviceModel>

</configuration>

No Comments