Just posting this so that I can find it again: I tend to rely heavily on Simon Fell's TcpTrace utility when testing and diagnosing Web Services, so with WSE and WCF there's usually a need to write some code in the client to have the client-side proxy call the server through TcpTrace correctly. Here's the code for both scenarios:

WSE

Just change the destination EndpointReference to include a Via URL:

Uri serviceUri = "http://localhost:8080/TypeInfo/TypeSvc.asmx";

Uri tcpTraceUri = "http://localhost:8080/TypeInfo/TypeSvc.asmx";

proxy.Destination = new EndpointReference(serviceUri, tcpTraceUri);

WCF (as of Feb06 CTP)

Just add a new Via behavior (from System.ServiceModel.Description) to the service endpoint:

TypeInfoServiceContractProxy proxy = new TypeInfoServiceContractProxy();

Uri tcpTraceUri = new Uri("http://localhost:8080/TypeInfo");

proxy.Endpoint.Behaviors.Add(new ViaUriBehavior(tcpTraceUri));

I think I like WCF's way of doing it a little bit more. Though it is not as obvious at first, it seems very logical and fits the overall model, at least imho.

Update:

I hadn't noticed that Aaron Skonnard had also blogged about how to do this for WCF by changing the server-side configuration here. Also, here's to how to do it on the client-side using configuration as well:

 <behaviors>

    <behavior name="tcpTraceBehavior">

       <channelViaUri viaUri="http://localhost:8080/TypeInfo"/>

    behavior>

 behaviors>

  <client>

     <endpoint address="http://localhost:81/TypeInfo" binding="wsHttpBinding"

         bindingConfiguration="WSHttpBinding_TypeInfoServiceContract2"

         contract="IndigoClient.TypeInfo.TypeInfoServiceContract"

         name="WSHttpBinding_TypeInfoServiceContract"

         behaviorConfiguration="tcpTraceBehavior"

      />

  client>

 


Tomas Restrepo

Software developer located in Colombia. Sr. PFE at Microsoft.