jkrier
7 years agoRegular Contributor
Retrieve binding properties/values with groovy script
I would like to get the WSDL Definition Namespace in a Groovy script. I tried looking at the code completion to see if I could find anything useful and this is the best I could get.
def iList = runner.project.getInterfaceList() log.info iList for ( i in iList ) { log.info i.name }
I didn't really see anything else that was useful. I have just 1 interface in my project.
If anyone knows how to do this it would help me out.
Try it like this:
String tns = testRunner.testCase.project.getInterfaceByName('ServiceActivationRouter') .getWsdlContext() .getDefinitionParts()[0] .getContent() .with { new XmlSlurper().parseText(it)} .with { definitions -> definitions.@targetNamespace.text() }