Forum Discussion

Philip_Baird's avatar
Philip_Baird
Community Expert
13 years ago

Dynamically setting the endpoint URI for Web Service testing

I am wanting to test a web service where the URI of the consumed WSDL begins with 



http://amisoa...



Unfortunately, due to the way the network is setup, I need to send the request directly to the IP, e.g.



http://10.20.1.157:8011



Is there any way of setting the endpoint URI at the time of test execution as it appears to be hard coded and unchangable?

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Phil,



    Endpoint address is hardcoded in the WebServices test item and cannot be changed during runtime.

    You may consider creation of several WebService test items for the same web service, one item per address, and create a wrapping function that will return the needed WebService test item. Then use the result of this function call instead of the WebServices.<nameOfWebServiceTestItem>... clause.

    E.g. (DelphiScript pseudo-code):



    //const cWSName = 'WSamisoa';

    const cWSName = 'WS10_20_1_157';



    function getWebService() : OleVariant;

      var oWebService : OleVariant;

      var strWebServiceName : string;

    begin

      result := evaluate('WebServices.' + cWSName);

    end;

    ...

    // instead of

    // oResultset := WebServices.WS10_20_1_157.someMethod();

    // use

    oResultset := getWebService.someMethod();

    // process resultset returned by the web service here