Forum Discussion

Awesome's avatar
Awesome
Frequent Contributor
17 years ago

how do i grab vars that hold wsdl & soapbinding

hi all,

Which variable(s) holds the following 3 pieces of data:

on the Project level, under the 'Interface Summary' section:
  1) SoapBinding
on the SoapBinding level, under 'Wsdl definition'
  2) WSDL URL
and under 'Definition Parts'
  3) "name of wsdl"

(maybe they're all the same var or 3 distinct ones?)

thanks.

5 Replies

  • Hi!

    - WsdlInterface.getBindingName() gets the QName of the binding in the WSDL
    - the WSDL URL/name is WsdlInterface.getDefinition()

    was that what you meant?

    regards!

    /Ole
    eviware.com
  • Awesome's avatar
    Awesome
    Frequent Contributor
    hi Ole,

    i get the error: "No such property: WsdlInterface for class"

    to need to include a library?

    also how would i assign the value return by wsdlInterface back to the project level properties. is it something like: 'context.setPropertyValue("property1", "${value}").

    thanks!
  • Hi!

    sorry.. exactly where in soapUI will you be you running this?

    regarding setting of properties, you will need to get hold of the project and set the property value that way, for example

    def project = testRunner.testCase.testSuite.project
    project.setPropertyValue( "property1", value )



    regards!

    /Ole
    eviware.com
  • Awesome's avatar
    Awesome
    Frequent Contributor
    hi Ole,

    so i have a project level property that is used throughout.

    i'd like to grab the wsdl (url/local file name) and set it as the value for the project level property.

    i was thinking to run this from within the 'Load Script' at the project level or from a groovy script within a "setup" testsuite...

    thanks for your help!
  • Hi!

    ok.. from within the load script you would do something like

    project.setPropertyValue( "wsdl", project.interfaces["nameofinterface"].definition )

    or if in a setup script you would first do

    def project = testSuite.project
    ...

    Hope this helps!

    /Ole
    eviware.com