WCF client unit test/integration test

本秂侑毒 提交于 2020-01-07 06:44:11

问题


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?


回答1:


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

  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.


来源:https://stackoverflow.com/questions/20148345/wcf-client-unit-test-integration-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!