+ Start a Discussion

Help me with this webservice code

I have a requirement to fetch all the record ids of a custom object called Meetings  (Api name  Event__c),

This webservice is being called from a Asp.Net website .


The requirement is to get all the record ids in a drop down list in Asp.net.


Please help me with this code , and let me know how far is this correct and what needs to be done..


global class MeetingId{

global class meetingWrapper{
        webservice List<Event__c> Meetings;
        global meetingWrapper(List<Event__c> mList){
            Meetings = mList;


webservice static List<meetingWrapper> getMeetingsWebMethod(){
List<meetingWrapper> Meetings = new List<meetingWrapper>();
            HTTPResponse res = new HTTPResponse();
            Http http = new Http();
            HttpRequest req = new HttpRequest();
            String EndPoint = 'https://www.tctmd.com/services/api.aspx?';
            req.setHeader('Content-Type', 'application/json');
            res = http.send(req);            
            list<Event__c> meetingList = new list<Event__c>();
            meetingList = [select id from Event__c];
            Meetings.add(new meetingWrapper(meetingList));
       }catch(Exception ex){
       return Meetings;




Try to generate and consume Enterprise WSDL in your .net application.


If that does not help try to explain the requirement in detail? I am little bit confused with the code - you are trying both webservice and callout on the same code.