Fiddler2中未显示WCF呼叫 [英] WCF Call not showing in Fiddler2
问题描述
我有一个带有basicHttp绑定的简单WCF服务.该服务在IIS7中本地托管(Win7便携式计算机).我可以在以下位置浏览服务: http://localhost/musicstore/musicstore.svc (端口80)
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)
我已经开发了一个简单的Windows窗体客户端应用程序来调用该服务.它工作正常,但我真的很想通过Fiddler2看到消息的调用/响应.当我浏览Web时,Fiddler2会很高兴地报告访问量,所以我不明白为什么它没有接听此WCF呼叫?
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?
还有另一种方法来查看WCF调用中的数据.也许有一个Microsoft工具?
Is there another way to view the data on WCF calls. Maybe there's a Microsoft Tool?
客户端配置为:
<?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>
服务配置为:
<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>
推荐答案
查看WCF正在做什么的最简单方法是打开WCF自己的登录记录.您可以通过编辑web.config并添加
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 具有有关您可以配置的内容的更多详细信息.您可以在服务跟踪查看器中查看日志.
MSDN has more detailed information on what you can configure. You can view the logs in the Service Trace Viewer.
这篇关于Fiddler2中未显示WCF呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!