Skip to content

Instantly share code, notes, and snippets.

@pradhyu
Created February 8, 2019 02:22
Show Gist options
  • Save pradhyu/2c7ef912949c71fd1ca3358bb7b3da56 to your computer and use it in GitHub Desktop.
Save pradhyu/2c7ef912949c71fd1ca3358bb7b3da56 to your computer and use it in GitHub Desktop.
Soap ui client using groovy grab
@Grab('com.github.groovy-wslite:groovy-wslite:1.1.2')
import wslite.soap.*
def client = new SOAPClient('http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx')
def response = client.send(SOAPAction:'http://www.27seconds.com/Holidays/US/Dates/GetMothersDay') {
body {
GetMothersDay('xmlns':'http://www.27seconds.com/Holidays/US/Dates/') {
year(2011)
}
}
}
println(response.GetMothersDayResponse.GetMothersDayResult.text())
assert "2011-05-08T00:00:00" == response.GetMothersDayResponse.GetMothersDayResult.text()
assert 200 == response.httpResponse.statusCode
assert "ASP.NET" == response.httpResponse.headers['X-Powered-By']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment