How can I do a SOAP post using RestAssured ?

3,837 views
Skip to first unread message

Jon Thor Austen

unread,
May 20, 2012, 8:50:02 PM5/20/12
to rest-a...@googlegroups.com
I am new to web services testing, but I haven't been able to find any information on your site or examples in the forum of how to do a SOAP request using RestAssured.
 
Given this webservice below, can anyone provide a most basic example of POSTing a SOAP envelope and getting a response using RestAssured??
 

Johan Haleby

unread,
May 21, 2012, 2:11:34 AM5/21/12
to rest-a...@googlegroups.com
SOAP is just XML so you can parse it and send it just as you would with standard XML with REST Assured. Other than this there's no special support for SOAP.

Regards,
/Johan
Message has been deleted

djangofan

unread,
May 22, 2012, 12:08:20 AM5/22/12
to rest-a...@googlegroups.com
Thanks, I figured it out:

String xml = given().request().header("SOAPAction","authenticate")
     .contentType("application/soap+xml; charset=UTF-8;").body(myEnvelope).when()
     .post( "/myserviceuri/mynamedport" ).andReturn().asString();

I needed to pass the SOAPAction header (defined in the WSDL) in order to do it.

-Jon

djangofan

unread,
May 22, 2012, 12:42:03 AM5/22/12
to rest-a...@googlegroups.com
I posted a blog article about it, in case anyone is interested:
 
 
-jon

Johan Haleby

unread,
May 22, 2012, 2:07:34 AM5/22/12
to rest-a...@googlegroups.com
Thanks for sharing!

Regards,
/Johan

Pradeep Annamraju

unread,
May 3, 2014, 1:08:57 AM5/3/14
to rest-a...@googlegroups.com
The link given is not working http://thegreenoak.blogspot.com/2012/05/using-restassured-to-do-soap-web.html
Is there any updated link?
Thanks
Pradeep

Lalith Choudary

unread,
Aug 14, 2014, 8:00:46 PM8/14/14
to rest-a...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages