使用 Fitnesse 测试 WCF 服务,我应该添加 WebReference 吗?

发布于 2024-07-29 18:49:21 字数 158 浏览 1 评论 0原文

我想使用 Fitnesse 对 WCF 服务进行子系统测试。

现在要测试 WCF 服务,我是否应该添加“WebReference”,并添加在某处托管服务所需的 Web 引用?

我相信 Fitnesse 作为该服务的新消费者,它应该添加 WebReference。

I want to use Fitnesse to do a subsytem testing of a WCF service.

Now to test a WCF service should I add the 'WebReference', and to add the webreference I require to host the service somewhere?

I believe Fitnesse as a new consumer to the service and it should add the WebReference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落花浅忆 2024-08-05 18:49:21

对于 WCF,您应该在 Visual Studio 中使用“添加服务引用”,或在命令行上使用 svcutil.exe。

您可以从正在运行的服务添加引用(然后需要将其托管在某个地方,是的),也可以提取元数据(描述服务操作的 WSDL 和描述消息结构的 XSD;再次使用 svcutil .exe)到文件并从这些文件创建客户端代理。

如果您只想测试实际的服务实现(中间没有 WCF 管道),您当然也可以添加对服务实现所在的程序集的普通引用(您希望将其隔离到类库中!),实例化服务类,并调用其方法。 取决于你真正想在这里测试什么......

马克

For WCF, you should use "Add Service Reference" in Visual Studio, or svcutil.exe on the command line.

You can either add the reference from a running service (and then it needs to be hosted somewhere, yes), or you can extract the metadata (the WSDL that describes the service operations and the XSD that describe the message structures; again, using svcutil.exe) to files and create your client side proxy from those files.

If you only want to test the actual service implementation (without the WCF plumbing in between), you could of course also just add a normal reference to the assembly where your service implementation lives (which you hopefully isolated into a class library!), instantiate the service class, and call the methods on it. Depends on what you really want to test here...

Marc

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文