Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

WSDLInterface.setDefinition() help

would it be possible to show some sample code on how to use this function.

We have a total of 17 webservices so we maintain a seperate project for each service. However since services are some time dependent, a project can have more than 1 interface.

I want to accomplish 2 things.

1. based on the environment settings in my external groovy, I would like all the interfaces for some project to point to the same environment. I have a project load script that configures the endpoints but I also want to set the WSDL definition URL from the load script. Not sure how to use WSDLInterface.setDefinition() to do this.

2. In the project load script, I want to be able to load all of my 17 interfaces so that the QA person does not have to worry about importing interfaces. If some interface is already loaded, then it should not overwrite (since QA person might have set some values)

Thanks

Ali

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    Some answers:

    1) The setDefinition method just sets the URL to use when loading the corresponding WSDL for validation, etc. If you set this via the API, any cached definitions will be cleared. Use like

    project.interfaces["SoapService123"].definition = "http://...."


    2) You would have to check for each corresponding interface in the project (via the definition url?), and import those missing with

    project.importWsdl( wsdlUrl, true )


    Hope this helps,

    regards!

    /Ole
    eviware.com