You need to sign in to do that
Don't have an account?

Implementing Apex callouts
Hi,
I am trying to implement a Apex callout to a websrvice. For this i have so far performed the following procedure.
Generating the WSDL class and setting up Endpoint URL in the remote settings. So now i am stuck with how to call the service method from Apex and test if the connection is made.
URL: www.gapcentral.com/Ajax.asmx
Service method: GAPNetworkImages()
Thanks in Advance.
nothing different than normal
you used the remote services WSDL to create the APEX class.
setup->develop->apex class-> generate from WSDL
then you write some other apex code, you get an instance of that class classname serv_object= new classname();
then you call the method in the classname thru the object.. server_object.method(parms)..
here is that section from one of my apps.. note that this is from a trigger, and you have to do some special re-coding in the wsdl created code
to add an @future method, as the web service takes too long to run on the trigger thread.
Sam
Hi,
Thank you so much for your response.
The process i have performed till now is i have a .net webserivce that we use for our application named Ajax.asmx. so i generated a WSDL Apex class from this webservice. Now my task is i have a method in this service which is trying to check for the existence of certain image files from our newtowrk and if they dont we need to update certain fields in SFDC.
What should my Apex class be like after i query a list of people, i would have to pass this list to the service and check for the images existence.
Please suggest.
can u be a little more clear..
what is a 'list of people'? SFDC 'users', or account 'contacts'.
what does 'list' mean..
in the service i showed, the wsdl said there was an array of 0..n, items, this then turns into an array of that object.
what does your wsdl say?
mine says
the wsdl definition of the wsCommewnt object looks like this
so the api takes an array of those objects.
in apex that is
wsComent[] list_of_comments;
I modified the apex wsdl class to create a method to find the comments, and build a 'list' object,
which the wsdl marshalls into an array for you
request_x.cases = caseList(problem);
request_x.comments = commentList(problem);
request_x.attachments = attachmentlist(problem);
my web service handler processes that parameter as a list of wsComments
private static String CommentstoList(WsComment[] comments, boolean create);
Sam