Reply
Regular Contributor
SFDCConsultant
Posts: 39

Problem displaying list of items returned from WebService Callout

Good afternoon,

 

I am having trouble displaying a list of items returned from a webservice callout.

 

On the visual force page I receive the following error:

 

Error: Unknown property 'WebServ.CampaignType.name'

 

 

Visual force page:

 

<apex:repeat value="{!CFCampaigns}" var="campaignList"> {!campaignList.name}  

</apex:repeat>  

 

 

Here's my controller code: 

Public List<WebServ.CampaignType> CFCampaigns;

  

public CF_ctlr() { WebServ.BroadcastServiceHttpPort webService = new WebServ.BroadcastServiceHttpPort(); WebServ.ArrayOfCampaignType result = webService.getFullCampaignList('2134ds'); this.CFCampaigns = result.CampaignType; } public List<WebServ.CampaignType> getCFCampaigns() { return this.CFCampaigns; } public String getCampaignId() { return this.CFCampaigns[0].name; 

} 

 

 

 

 I verified that the property does exist and the getCampaignId method in my controller works. 

 

Any ideas?

 

Thanks,

Michael 


Moderator
bob_buzzard
Posts: 4,866

Re: Problem displaying list of items returned from WebService Callout

[ Edited ]

That smacks that there isn't a getName method on the WebServ.CampaignType object.

 

In your getCampaignId, you use : return this.CFCampaigns[0].name, which is directly accessing the field.

 

However, when the VF page is rendering the contents of your repeat tag,  {!campaignList.name}

equates to campaignList.getName()

Message Edited by bob_buzzard on 03-09-2010 01:02 AM
--
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter


If my answer helps, its your call to mark it as the solution - I'm not going to guilt you into it.


Regular Contributor
SFDCConsultant
Posts: 39

Re: Problem displaying list of items returned from WebService Callout

The WebServ object/class is generated by WSDL2Apex. 

 

Thanks ,

Michael