0

Please help!!

What is the correct way to send List of String as a parameter to webservice ?

List < SObject > ObjectContents; // {get; set;} contains records of selected object List str3 = new List (); String FormattedValue;

 for (SObject a :  for (SObject a : ObjectContents)) // for (SObject a : ObjectContents)
 {
 for(String field:fieldApis){  //  fieldApis contains list of fieldnames
            FormattedValue = '\'' + a.get(field) + '\'' ;  //fetches value of each field
  }

  str3.add(FormattedValue );
   }

    //sending data to webservice
sqlArray19.ArrayOfstring a= new sqlArray19.ArrayOfstring();  
SQLServerConnector9.BasicHttpBinding_IService1 stub = new SQLServerConnector9.BasicHttpBinding_IService1();   

//sqlArray19 and SQLServerConnector9 classes were formed while importing wsdl into Salesforce

List<String> insertMsg = stub.InsertQuery(str3); // getting error in this line 

"Compile Error: Method does not exist or incorrect signature: [SQLServerConnector9.BasicHttpBinding_IService1].InsertQuery(LIST<String>)"

.net webservice which will fetch values from Salesforce and return those values

 public List<String> InsertQuery(List<String> Values)
    {
        return Values ;
    }
4

1 に答える 1

0

複数のプラットフォームで Web サービスを使用する場合、コレクションは厄介なデータ型になる可能性があります。List を string[] に変換してみてください (もちろん、メソッドを変更してください)。

于 2013-09-25T18:08:36.350 に答える