Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20755

How to attach ssl certificates to response using Groovy script

$
0
0

Hi,

 

I am trying to connect a web service using Groovy script which is happening successfuly and I am getting soap message back.However, I am not getting how to attach in incoming ssl certificates to in my response object. I am using following script.

 

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def soapUrl = new URL("https://xxxxxxxxxxxxx")
def connection = soapUrl.openConnection()

connection.setRequestMethod("POST")
connection.setRequestProperty("Accept-Encoding" ,"gzip,deflate")
connection.setRequestProperty("Content-Type" ,"text/xml;charset=UTF-8")
connection.setRequestProperty("SOAPAction", "xxxxxxxxxxxxxxxx")
connection.doOutput = true

def soapRequest = mockRequest.getRequestContent()
writer.write(soapRequest)
writer.flush()
writer.close()

connection.setConnected(true)
connection.connect()

def soapResponse = connection.content.text

requestContext.responseMessage = soapResponse

connection.disconnect()

Viewing all articles
Browse latest Browse all 20755

Trending Articles