Thursday 26 January 2017

                                    Apex Integration:


Apex callouts come in two flavors.

1.Web service callouts to SOAP web services use XML, and typically require a WSDL document for code generation.
2. HTTP callouts to services typically use REST with JSON.

These two types of callouts are similar in terms of sending a request to a service and receiving a response. But while WSDL-based callouts apply to SOAP Web services, HTTP callouts can be used with any HTTP service, either SOAP or REST

So you are probably asking yourself right now, “Which one should I use?” Whenever possible, use an HTTP service. These services are typically easier to interact with, require much less code, and utilize easily readable JSON. You’ll probably use SOAP mostly when integrating with legacy applications or for transactions that require a formal exchange format or stateful operations.


Authorize Endpoint Addresses:

 Before you start working with callouts, update the list of approved sites for your org on the Remote Site Settings page.

https://th-apex-http-callout.herokuapp.com
https://th-apex-soap-service.herokuapp.com


Authorize both of these endpoint URLs by following these steps.

  1. From Setup, enter Remote Site Settings in the Quick Find box, then click Remote Site Settings.
  2. Click New Remote Site.
  3. For the remote site name, enter animals_http.
  4. For the remote site URL, enter https://th-apex-http-callout.herokuapp.com. This URL authorizes all subfolders for the endpoint, like https://th-apex-http-callout.herokuapp.com/path1 and https://th-apex-http-callout.herokuapp.com/path2.
  5. For the description, enter Trailhead animal service: HTTP.
  6. Click Save & New.
  7. For the second remote site name, enter animals_soap.
  8. For the remote site URL, enter https://th-apex-soap-service.herokuapp.com.
  9. For the description, enter Trailhead animal service: SOAP.
  10. Click Save.

2 comments:

  1. Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.
    Sales-Force Training in Chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete