Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in Salesforce by (11.9k points)
recategorized by

I would like to know the parameters for the invoke method used by Salesforce to invoke remote web services. I have a service that I'm supposed to be able to invoke, but the service WSDL does not define the security requirements, so I'm hoping I can add that information manually (The services uses WS-Security passed through Soap headers).

Here is what I (think I) know so far:

WebServiceCallout.invoke(

  Class servicePort, //Usually set to "this", contains httpheader info as well as ? 

  request_x, //Request object, defining schema, properties, and field order

  response_map_x, //Response object, defining schema, properties, and field order

  new String[]{

  String endpoint, //Endpoint of the service

  String ?, //what is this?

  String methodSchema, //Schema for the request object?

  String method, //Name of the request method?

  String responseSchema, //Schema for the response object?

  String response, //Name of the response object?

  String responseClass} //Name of the Apex class the response will be converted to

);

Can anyone help fill in the gaps?

1 Answer

+2 votes
by (32.1k points)
edited by

Parameters for Salesforce WebServiceCallout.invoke method are:

WebServiceinvoke( stub, request, response, infoArray)

Stub: Stub is an instance of the Apex class which is auto-generated from a WSDL ( an XML document that contains a standard description on how to communicate with web service). It is an Object type.

Request: Request is an instance which is created as part of an auto-generated stub class. It is an Object type.

Response: A map of key-value pair is used to get the response from the external service after it receives the request. It is a Map<String, Object> type.

Are you interested in learning Salesforce from scratch! Have a look at this interesting video on Salesforce provided by Intellipaat:

InfoArray: It is an array of strings containing information about SOAP action, callout—web service, response, and request. It is a String[] type.

To learn in-depth about Workflow in Salesforce, sign up for industry-based Salesforce Training!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...