Forum Discussion

Carel_Lotz's avatar
Carel_Lotz
New Contributor
16 years ago

Parameterized WSDL Location

Hi

I'm quite new to soapUI and was wondering whether it is possible to parameterize the WSDL location for the test suite that I'm creating.  The idea being that the tests will be run on different machines and ideally I want to change the location in one place and have it automatically reflect in all the calls being made.  I was unable to find anything about this in the documentation  but I'm sure it must be possible.  Any ideas?

Thanks

7 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you can use property-expansion syntax in the WSDL location property, for example if you create a project-level property named "WsdlHost" you could then use it in your WSDL urls with "${#Project#WsdlHost}/path/to/my.wsdl"

    Is this what you had in mind?

    regards,

    /Ole
    eivware.com
  • Carel_Lotz's avatar
    Carel_Lotz
    New Contributor
    The problem is that when I add the WSDL's initially, they are added with the details of the machine that I referred the WSDL from.  For different developers this will not be the same and every developer should be able to run the same suite from their own machine using their own unique locations.  LocalHost works but it still refers to the machine name in the schema references etc. so I was looking to parameterize all of that so that I replace it once and it reflects everywhere where a location is required.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi again!

    so my above suggested solution should work!?

    1) Create a project-level property named "WsdlHost" and set its value to the initial host you want to import from
    2) Add a WSDL to your project and specify ${#Project#WsdlHost}/path/to/wsdl as the WSDL endpoint
    3) Change the value of the WsdlHost property as desired on different machines

    Or am I misunderstanding?

    regards!

    /Ole
    eviware.com
  • Carel_Lotz's avatar
    Carel_Lotz
    New Contributor
    Being quite new to soapUI it seems like you already support this scenario in that when you execute the test suite you can dynamically specify the host against which to run it.  This also applies to the command line testrunner.bat invocation through using the /h parameter.  This allows me to run the same tests against any host, correct?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    If I understand you correctly you are asking about the possibility of dinamicaly changing endpoints against which you run the tests?

    When opening Interface under ServiceEndpoints tab you can specify a number of different endpoints which than you can change on TestRequest level of execution. However since a TestCase can contain TestRequests tied to different interfaces you can't do the same on TestCase (nor TestSuite) level.

    Hope this helps you.
    Regards, Dragica
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you can also use properties in your endpoints to easily change the target server for a number of requests, ie define a property at the Project level (for example "TestHost") and then use it in your endpoints with for example "${#Project#TestHost}/path/to/service". You can then override the TestHost value from the command-line using the -P option, ie -PTestHost=http://some.otherhost.com

    The -h option is primarily viable when you are using only one target host in all your requests (since it will change all hosts to the specified value)

    Hope this helps!

    regards,

    /Ole
    eviware.com