Forum Discussion

ItP_1's avatar
ItP_1
Occasional Contributor
11 years ago

How to call a Webservice through Groovy script?

Hi Friends,

 

I have a below test plan setup and I need support in calling a webservice using groovy script

 

Test Step-1: Call Rest Api and proivde input parameters

Test Step-2: JDBC Request-Query DB, Asser it against the Test Step-1's response

Test Step-3: Call another webservice lile "http://webserviceqa.domain.net/xyz.svc?wsdl" and pass input parameters to that webservice methods

Test Steo-4: Do assertions

 

I have a problem is doing Test Step-3. How do I achieve this test step-3 sceanrio?

I tried with the below groovy script

 

import groovy.net.soap.SoapClient
def client= new SoapClient('https://webserviceqa.domain.net/xyz.svc?wsdl')
def response=client.send(<tried passing the entire soap request i used to pass for the webservice>)

 

the above did not work for me..

 

Please help me achieve this.. Awaiting expert support.

 

Thanks,

ItP

UMG

 

 

No RepliesBe the first to reply