SoapUI Webservice Testing: Can we test an API connection through SoapUI without running the API?

71 views Asked by At

I come across a requirement to test if the webservice is responding(API Monitoring). Although we can't run the API as it is a Production API and it will issue orders.

I am currently using SoapUI and wondering if there's a way we could do it there?

Thanks.

1

There are 1 answers

0
ou_ryperd On

Do the following in a Groovy Script step:

def req = new URL("http://www.dneonline.com/calculator.asmx?wsdl").openConnection()
def resp = req.getResponseCode()


if (resp.equals(200)) {
    log.info('pass')
    def respContent = req.getInputStream().getText()
}
else {
    log.info('fail')
}