Reputation: 8701
I have a simple WCF Service with basicHttp binding. The service is hosted locally (Win7 laptop) in IIS7. I'm able to browse the service at: http://localhost/musicstore/musicstore.svc (port 80)
I've developed a simple windows form client app to call the service. It works fine but I'd really like to see the message call / response through Fiddler2. Fiddler2 will happily report traffic as I browse the web so I can't understand why it's not picking up this WCF call?
Is there another way to view the data on WCF calls. Maybe there's a Microsoft Tool?
The client config is:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="http://localhost/musicstore/musicstore.svc"
binding="basicHttpBinding" bindingConfiguration="" contract="MusicStore.IMusicStore"
name="BasicHttp" />
</client>
</system.serviceModel>
</configuration>
The service config is:
<services>
<service behaviorConfiguration="MusicStoreBehavior" name="MusicStore">
<endpoint address="" binding="basicHttpBinding" contract="IMusicStore">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
Upvotes: 10
Views: 11489
Reputation: 57075
There are many duplicates of this question, many of which have correct answers. You should use http://localhost.fiddler/ as the target and .NET will properly proxy the request. Fiddler will then change "localhost.fiddler" to "localhost" before passing on the request.
Upvotes: 8
Reputation: 2987
I had the same problem and fixed it this way:
Use the proxy configuration of dutch nico (see below)
Make sure your client application uses your 'external' ip. So 192.168.1.X instead of localhost.
You might have to change your WCF config to allow multiple bindings for asp.net 4.0
<serviceHostingEnvironment multiplesitebindingsenabled="true"/>
Upvotes: 0
Reputation: 270
You can modify your client's configfile:
<configuration>
<system.net>
<defaultProxy>
<proxy bypassonlocal="false" usesystemdefault="true" />
</defaultProxy>
</system.net>
</configuration>
Or you could use:
GlobalProxySelection.Select = new WebProxy("127.0.0.1", 8888);
From: Fiddler site
Upvotes: 3
Reputation: 56490
The easiest way to see what WCF is doing is to turn WCF's own logging on. You can do this by editing your web.config and adding
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="messages"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\logs\messages.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.serviceModel>
<diagnostics>
<messageLogging
logEntireMessage="true"
logMalformedMessages="false"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="3000"
maxSizeOfMessageToLog="2000"/>
</diagnostics>
</system.serviceModel>
MSDN has more detailed information on what you can configure. You can view the logs in the Service Trace Viewer.
Upvotes: 15