Activity Forums Salesforce® Discussions How does SOAP and REST Communicate in Salesforce?

  • Archit

    Member
    March 26, 2018 at 9:24 am

    Hello Rahul,

    SOAP & REST both are use for integration purpose, SOAP will communicate through WSDL file while the REST will communicate through HTTP file.

    Thanks!

  • Neha

    Member
    March 26, 2018 at 11:24 am

    Hi Rahul,

    You have a REST Server and a SOAP Server, both of their goals is to wait for requests from their respective clients -- it doesn't matter if the operations they implement read and/or write their data sets, a client still needs to initiate communication.

    Bridge the gap.
    Because of this, you'll need a bridging client to request to read something from the REST Server and request to write something into the SOAP Server. The rest of the infrastructure for the bridge is up to you.

    You can write a light script that pulls RESTful data and pushes SOAP messages for a handful of particular RESTful resources or you can write a general purpose REST2SOAP bridge which can map a RESTful resource to a SOAP message endpoint based on a conversion convention.

    Direct vs. Message Queues.
    Writing an abstract bridge client will allow you to run it by directly calling the REST service, receiving data, processing it, directly calling the SOAP service and sending it the data. If this is a low-load situation that's fine.

    If we have a high load of data to process doing things synchronously will not be feasible, so we introduce message queues.

    The producer:

    • reads data from the REST service;
    • (perhaps) processes it into a local form (which the bridge client understands such as arrays and objects);
    • then serializes it (serialize, json_encode, etc.);
    • puts it on a message queue.

    The consumer(s)

    • listen to the message queue;
    • when it receives a new message it deserializes it;
    • processes it;
    • sends it to the SOAP service.

    The overall advantage of the message queues is the fact that you can start up as many producers or consumers as you need depending on which of these services runs slower.
    share

     

    Hope this helps you.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos