WCF 客户端单元测试/集成测试 [英] WCF client unit test/integration test
本文介绍了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:
- 创建一个新的 SoapUI 项目
- 作为初始 WSDL 提供本地服务的 url(添加 ?wsdl)或外部服务的 WSDL
- 右键单击生成的端点并选择 Generate MockService 选项.选择合适的路径和端口.
- 您可以编辑将使用的默认响应.
- Create a new SoapUI project
- As a Initial WSDL provide url of you local service (with ?wsdl added) or WSDL of external service
- Right click generated endpoint and select Generate MockService option. Select appropriate path and port.
- You can edit default response that will be used.
这篇关于WCF 客户端单元测试/集成测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文