Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.34 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.34 KB

soapor

SOAPor is a java SOAP client.

Build Status

  • 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

The mvn dependency:

<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>

Usage:

Basic usage:
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);
Matcher:
SOAPMessage soapMessage = SOAPMessageFactory.create("com/github/sinall/soapor/payload/example.xml");
assertThat(soapMessage, hasValueInXPath("/Envelope/Body/doubleAnInteger/param1", "123"));