I created the APEX class from the WSDL of an ASP.NET asmx service, this now gives me access to the types and methods provided by my service.
One of the methods takes in a List of objects described by the method: (ex: ASP.NET method)
[XmlInclude(typeof(List))] [WebMethod(Description = "Consumes a list of changes from Salesforce.")] public void NotifyChanges(List<SalesforceChangeType> changes) { foreach (var changeType in changes) { log.Info(string.Format("Type:{0}, Id:{1}", changeType.ChangeType, changeType.EntityId)); } }
I am trying to call this web service but when the APEX class was generated it created a type of ArrayOfSalesforceChangeType which is also the argument for the method.
TriggerService.SalesforceChangeType change = new TriggerService.SalesforceChangeType();
TriggerService.ArrayOfSalesforceChangeType changes = new TriggerService.ArrayOfSalesforceChangeType();
TriggerService.TriggerServiceSoap svc = new TriggerService.TriggerServiceSoap();
changes.add(change) <-- doesn't work, reports "Method doesn't exist or incorrect signature"
// changes[0] = change; <-- doesn't work either "Expression must be a list type: Service.ArrayofSalesforceChangeType"
svc.NotifyChanges(changes);
So my question is how do I add items to a custom List that was generated from the APEX generated WSDL..
Hope this makes sense to someone..
Thanks