Wiremock: Make SOAP stubbing awesome

Created on 21 Sep 2017  路  2Comments  路  Source: tomakehurst/wiremock

It would be awesome to have better SOAP support and Mark D. Sievers has provided a nice snippet for this in this StackOverflow answer:

Setup:

public <T> void stubOperation(String operation, Class<T> clazz,
                              Predicate<T> predicate, Object response) {
    wireMock.stubFor(requestMatching(
                     new SoapObjectMatcher<>(context, clazz, operation, predicate))
                    .willReturn(aResponse())
                    .withHeader("Content-Type", "text/xml")
                    .withBody(serializeObject(response))));
}

Usage:

SoapContext context = new SoapContext(...); // URIs, QName, Prefix, ect
context.stubOperation("createUser", CreateUser.class, (u) ->
     "myUser".equals(u.getUserName()), new CreateUserResponse());

soapClient.createUser("myUser");

Could something based on that be added to WireMock?

Feature request

Most helpful comment

I'd love to be able to tackle this problem properly, but I'm unlikely to find the time for it in the near future unfortunately.

Having said that I was always planning to add SOAP support as an extension library rather than to WireMock's core, so there's no reason it has to be me that works on it.

All 2 comments

Any chance this gets implemented @tomakehurst? I'd really like to not use SOAPUI for SOAP-Testing.

I'd love to be able to tackle this problem properly, but I'm unlikely to find the time for it in the near future unfortunately.

Having said that I was always planning to add SOAP support as an extension library rather than to WireMock's core, so there's no reason it has to be me that works on it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neilg picture neilg  路  4Comments

rpax picture rpax  路  3Comments

j3t picture j3t  路  5Comments

MOUBARAKI picture MOUBARAKI  路  5Comments

OllyAndJo picture OllyAndJo  路  5Comments