[SWS-263] Provide xml based Mock for Web Services Created: 08/Jan/08  Updated: 04/May/12  Resolved: 04/Jan/11

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5 M1, 1.0.3
Fix Version/s: 2.0 GA

Type: New Feature Priority: Major
Reporter: Eberhard Wolff Assignee: Arjen Poutsma
Resolution: Complete Votes: 8
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive test.zip    
Issue Links:
is related to SWS-440 WebServiceTemplate still creates a co... Closed


To do tests with a Web Service system it would be nice to be able to mock the system in an easy way. The idea is to define which XML request is answered by which XML response. This allows the test to use recorded XML from an existing systems. Also the test is very low level and therefore agnostic of the used serialization mechanism. It can also easily simulate faults and errors of all kinds. Therefore it would be a nice idea for integration tests and would be in the spirit of the mocks for JNDI etc provided by Spring Core.

For this the WebServiceTemplate must be subclassed. The createConnection() method must be changed in a way that a Connection is returned that provides WebServiceMessages as defined by the XML files. The comparision of the XML request to the recorded XML requests can be implemented using XMLUnit for example.

Comment by Albert Deinbeck [ 25/Jul/08 ]

I have written something like this for our project. I'll attach the project-independent parts, perhaps they are useful.

Comment by Lukas Krecan [ 21/Sep/09 ]

I am working on something similar. Please see SWS-544 or http://javacrumbs.net/spring-ws-test/.

Comment by Arjen Poutsma [ 04/Jan/11 ]

This has been implemented as part of SWS 2.0.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Tue Oct 23 12:55:59 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.