问题
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:
- 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.
来源:https://stackoverflow.com/questions/20148345/wcf-client-unit-test-integration-test