Ask a Question

Groovyscript to set Service Endpoint row or assign WSS configuration

timaharrison
Occasional Contributor

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 5
nmrao
Community Hero

Re: Groovyscript to set Service Endpoint row or assign WSS configuration

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.


Regards,
Rao.
timaharrison
Occasional Contributor

Re: Groovyscript to set Service Endpoint row or assign WSS configuration

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
Community Hero

Re: Groovyscript to set Service Endpoint row or assign WSS configuration

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.


Regards,
Rao.
timaharrison
Occasional Contributor

Re: Groovyscript to set Service Endpoint row or assign WSS configuration

Thanks again Rao.  Your solution sounds like a good one, using property expansions, but I'm struggling wih "Assigning this property at Interface level" (WSS Configuration)..  there aren't any custom properties at interface level. 

 

Hopefully I've explained myself properly. I don't need any usernames assigning, just the wss configurations

nmrao
Community Hero

Re: Groovyscript to set Service Endpoint row or assign WSS configuration

Please see the attachment

 

interface_properties.png



Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: