Yes, it is possible, however not necessarily easy.
SOAP Web service is (usually) receiving HTTP requests with XML in the body and sending back HTTP responses with XML in the body.
REST-assured can send HTTP requests with any content, including XML. It can also verify XML in responses with GPath.
Here's an example from REST-assured site:
Imagine that a POST request to http://localhost:8080/greetXML returns:
<greeting> <firstName>{params("firstName")}</firstName> <lastName>{params("lastName")}</lastName> </greeting>
<greeting> <firstName>{params("firstName")}</firstName> <lastName>{params("lastName")}</lastName> </greeting>
i.e. it sends back a greeting based on the firstName
firstName
and lastNamelastName
parameter sent in the request. You can easily perform and verify e.g. the firstNamefirstName
with REST assured:given(). parameters("firstName", "John", "lastName", "Doe"). when(). post("/greetXML"). then(). body("greeting.firstName", equalTo("John")).
given(). parameters("firstName", "John", "lastName", "Doe"). when(). post("/greetXML"). then(). body("greeting.firstName", equalTo("John")).
The problem is that SOAP Requests and SOAP Responses are usually far more complex and you will need to understand WSDL descriptors yourself.