测试 WCF 服务
我有两个 WCF 服务。我知道其中之一可以工作,而其中之一不能。我的问题是我从 WP7 模拟器调用它们,但 Fiddler 中没有出现任何内容(即使对于正在工作的那一个,我已经尝试了一切方法来让东西工作) 。
无论如何,测试 WCF 服务的 POST 请求的推荐方法是什么?
I have two WCF services. I know that one of them works and one of them doesn't My problem is I'm calling them from WP7 emulator and nothing is appearing in Fiddler (even for the one that's working, and I've tried everything to get stuff working).
Regardless, what is a recommended way to test POST requests to a WCF service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我总是尝试使用 TDD 进行开发。这意味着我创建一个单元测试项目,并使用单元测试来测试我的服务。
I always try to develop using TDD. This implies that I create a unit test project, and use unit tests to test my services.
您问的两个问题略有不同,所以我将分别回答。
首先,您在使用 fiddler 嗅探 WP7 模拟器流量时遇到了一些麻烦。当您使用 WP7 模拟器时,有时 fiddler 会拒绝嗅探 WiFi 流量。就我而言,只有当我关闭 WiFi 并使用以太网电缆(当然还有 WP7 设备的数据线)时,fiddler 才开始嗅探。所以禁用wifi是一种选择。第二个选项是重新配置 fiddler。请检查此主题(它是关于配置 fiddler 以与 WP7 配合使用):Windows Phone 7 嗅探器
你的第二个问题是关于工具的。我使用(很长一段时间)一个非常有用的工具,名为 soapUI。只需安装它,创建新项目并享受乐趣。请注意,使用soapUI 创建新项目时应输入wsdl 的路径。它看起来像这样:myservicename.svc?wsdl
我希望这会对您有所帮助。无论如何,如果你有问题,请提问。
You're asking two slightly different questions so I'll answer to them separately.
So first of all you have some troubles with sniffing WP7 emulator traffic using fiddler. Sometimes fiddler rejects to sniff WiFi traffic when you use WP7 emulator. In my case fiddler started sniffing only when I turn off WiFi and use Ethernet cable (and data cable for WP7 device of course). So disabling wifi is one option. And second option is reconfiguring fiddler. Please check this topic (it's about configuring fiddler for work with WP7): Windows Phone 7 sniffer
So your second question about tools. I use (for a pretty long time) one really useful tool named soapUI. Just install it, create new project and have a fun. Please note that you should enter path to wsdl when creating new project with soapUI. It will look like this: myservicename.svc?wsdl
I hope this will help you. Anyway please ask questions if you have some.