Below given is the simple web service.This web service has been written in apex and I am calling it from Apex as I am working on two salesforce orgs.I am calling getMessage () from my org and passing opportunity name as parameter and method queries salesforce database and then return the fetched record.Uptill now it has worked fine and it works fine with one record.It generated an esception that list has more tham one row for assignement.How do I make it work with multipe records.How do I send more than one record as return value to the calling method.Can somebody please help.
Thanks a lot Daniel,
I have changed my web services a bit and instead of string I am trying to return list of opportunity records to the the calling apex code.However I get an error message,illegal assignment from list to list.Can u please suggests.
This is how I am making callout.
list<opportunity>q=new list<opportunity>();
q=apx.GetMessage('Newone')
global class Greatone
{
//set p=new set();
WebService static list<opportunity> GetMessage(string msg)
{
string g;
list<opportunity> opp=[select id,name from opportunity where name=:msg];
return opp;
}
}