SOAPor is a java SOAP client.
- Build a payload based on template and a map
- Send the payload to a web service and get response
- Extract the response result by XPath
<dependency>
<groupId>com.github.sinall</groupId>
<artifactId>soapor-core</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.github.sinall</groupId>
<artifactId>soapor-matchers</artifactId>
<version>1.1.3</version>
</dependency>
import com.github.sinall.soapor.*;
// ...
SOAPParameters params = new SOAPParameters();
params.put("param1", "123");
SOAPRequest request = SOAPRequest.getInstance("com/github/sinall/soapor/payload/example.xml", params);
log.info("Request soap message to {}:\n{}", endpoint, request);
SOAPClient client = new SOAPClient(endpoint);
SOAPResponse response = client.send(request);
log.info("Response soap message:\n{}", response);
SOAPMessage soapMessage = SOAPMessageFactory.create("com/github/sinall/soapor/payload/example.xml");
assertThat(soapMessage, hasValueInXPath("/Envelope/Body/doubleAnInteger/param1", "123"));