WCF 客户端单元测试/集成测试 [英] WCF client unit test/integration test

查看:39
本文介绍了WCF 客户端单元测试/集成测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 SOAP Web 服务生成了一个代理客户端.我想测试请求信封而不实际调用另一端的服务(实际端点)现在,我将我的测试包装在 try/catch 块中,因为它会超时.因为我只是在测试请求正文,所以它们是一种伪造端点的方法吗?

I generated a proxy client to a SOAP web service. I would like to test the request envelop without actually calling the service at the other end (actual endpoint) for now, i wrap my tests in try/catch block as It will timeout. is they a way fake the endpoint as I'm only testing the request body?

推荐答案

SoapUI.以下是详细步骤:

Use New MockService option from within SoapUI. Here are detailed steps:

  1. 创建一个新的 SoapUI 项目
  2. 作为初始 WSDL 提供本地服务的 url(添加 ?wsdl)或外部服务的 WSDL
  3. 右键单击生成的端点并选择 Generate MockService 选项.选择合适的路径和端口.
  4. 您可以编辑将使用的默认响应.
  1. Create a new SoapUI project
  2. As a Initial WSDL provide url of you local service (with ?wsdl added) or WSDL of external service
  3. Right click generated endpoint and select Generate MockService option. Select appropriate path and port.
  4. You can edit default response that will be used.

这篇关于WCF 客户端单元测试/集成测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆