Showing results for 
Search instead for 
Did you mean: 

WebService: how to assign value to parameter


WebService: how to assign value to parameter


   I am testing a web service. Please see attached screen shot. The following is my code. Here "CSISServeWS" is the name of the web service. MarketParticipantIdentifier is one of the parameters and mandatory. After running the script, I got "search failed with exception that MarketParticipantIdentifier is invalid". It seems the value of "ATCO" was not passed in. I tried single quotation market or '\', no one works... Can you please let me know where I am wrong?

   Thanks in advance.



   var typeFactory = WebServices.CSISServeWS.TypeFactory;

   typeFactory.SiteIDLookupInParam.MarketParticipantIdentifier = "ATCO";

   typeFactory.SiteIDLookupInParam.SiteID = "010999865277";

   //following command doesn't return anything.


   var tmp = WebServices.CSISServeWS.GetSiteIDLookupResult(typeFactory.SiteIDLookupInParam);


RE: WebService: how to assign value to parameter

... figured out this ... would like to share, and welcome any inputs. Since the input parameter type of my web service is an object, SisteIDLookupInParam. So I have to create this object first and then assign values to its properties. TestComplete WebService Test editor has a button 'Code', which can be used to generate the code for creating the object. The followings are my code.

function Main()


   var myPara = new SiteIDLookupInParam();

   myPara.MarketParticipantIdentifier = "ATCO";

   myPara.CityName = "MUNDARE";


   var result = new SiteIDLookupResult();

   var result = WebServices.CSISServeWS.GetSiteIDLookupResult(myPara);




//the following is copied from Code generation button

function SiteIDLookupInParam()


  var  Result;

  var  TypeFactory;

  //Get the type factory for the web service

  TypeFactory = WebServices.CSISServeWS.TypeFactory;

  Result = TypeFactory.SiteIDLookupInParam;

  return Result;


New Here?
Join us and watch the welcome video:
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?

Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors