Forum Discussion

byter1's avatar
byter1
Occasional Contributor
14 years ago

WSDL: Username and Password on Service Endpoint

I am am looking to populate the WSDL username and password via groovy script and trying to find the appropropriate groovy class for this.

The dialogue with username and password that I am referring to is shown when you double click on a WSDL Service and select service endpoints.
The requirement for this is because I am using different systems with different credentials and need to dynamically set them at run time.

I have not been able to find this and wondering if one exists to use ?

Thanks for your help.

4 Replies

  • Hi,

    hmm.. I'm actually not really sure if you mean the username/password for the WSDL itself or for the requests defined in the WSDL... can you show a screenshot of which dialog you mean in the UI?

    regards,

    /Ole
    SmartBear Software
  • byter1's avatar
    byter1
    Occasional Contributor
    ScreenShot Attached.
  • Hi!

    ok.. try the following:

    def defaults = testRunner.testCase.testSuite.project.endpointStrategy.getEndpointDefaults( "<the endpoint>" )
    defaults.username = ...
    defaults.password = ..

    This is from a TestCase setup script but as long as you can get hold of the project you can run this anywhere..

    Does that work?

    regards!

    /Ole
    SmartBear Software