Forum Discussion

timaharrison's avatar
timaharrison
Occasional Contributor
9 years ago

Groovyscript to set Service Endpoint row or assign WSS configuration

I have a number webservices tests that need to run across different environments.  Presently I use another editor within the automated test to edit substrings within the project xml to to assign the endpoint and set environment specific WSS incoming and outpgoing security. 

 

I've searched within this forum and others for a way to do this using Groovyscript. I can import the values as properties and transfer them, doing a setEndpoint sets the endpoint fine, but the WSS security values do not change.  I need to be able to tell SoapUI to use the entire row (in the service endpoint) or to pick up/assign a particular incoming/outgoing security configuration.  Either of these would make this work for me.

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    May be you can try parameterize them. For example create a property file say soapui.properties and keep it under SOAPUI_HOME/bin, add a property, say username and assign it at the each interface level and assign it for user name say ${#Project#username}. Whenever you want to change, just make change in the property file before running the test.
    AS you know, soapui.properties files gets loaded each time when soapui is start is started. And not that value change in the property may need restart of soapui.
    Hope this helps.
    • timaharrison's avatar
      timaharrison
      Occasional Contributor

      Thanks Rao for replying. 

       

      I've already got all the environment-specific configurations set up within the Interface, I can also set up properties for transfering values.  My stumbling block is the method for assigning them within the groovyscript  (as you would use the Assign button on the Service Endpoints tag).  Any help with this I'd be grateful for.

      • nmrao's avatar
        nmrao
        Champion Level 3
        As mentioned earlier, assign ${#Project#username} once at interface or as many interfaces that is needed in that project. Then save it. That is all you need to do.
        You do not have to assign it again using groovy script at all. Or may be I am missing something. Or try the above once and post your issues or findings.