SK SKYVVA Documentation

6. SOAP Adapter

Introduction

Agent SOAP Adapter is a feature like SOAP Adapter, but it has more power than the SOAP Adapter. SOAP Adapter needs the System to have Public API to call out API, but Agent SOAP Adapter can callout API with Systems that have Public API and Local API. So it is useful for users who want to keep data in the local System. To use Agent SOAP Adapter, we need to have an Agent application to store in the local machine meaning that Agent SOAP Adapter is like a bright to connection Salesforce to the Agent machine and the Agent machine connects to Backend applications. Example: In a Real business scenario, we want to make our data secure, so we need to use a local network zone to install Agent machine and Backend applications such as SAP or Oracle. We do like this because we don't want any systems to access our System, and it is the technique to protect our data from being safe.

The processing of Agent SOAP Adapter

Here's the picture of the processing of Agent SOAP Adapter.

In this picture, we can see Salesforce and SKYVVA are in the Internet zone where Agent Machine and Backend applications are in the Local network zone. So when we callout from Salesforce to Backend applications, it will access Agent Machine and Agent Machine send data to Backend applications. The agent is responsible for making connections with the inside enterprise and then connecting with Salesforce (Internet zone). This Adapter is really helpful for users to send data to salesforce to local backend applications.

How to create a SOAP interface using the Agent SOAP Adapter?

How to use Agent SOAP Adapter for callout data from salesforce.  We also learn about how to callout data and get a response message and we will learn how to use fault Interface when the other system has a fault message.

Case 1

Handle API message without Response Interface.

Pre-require

Step 1:  Create or Upload Message Type SOAP.

–  SOAPVersion2_skyvvasolutions__MetaDataProvider__c (5)

Step 2: Create integration and outbound Interface.

Step 3: Configuration Agent Control Board.

How to use the Agent Control Board?

Since the user now completely understand; How to use the Agent Control Board, by hitting the upper link, now we understand the Architect of the Agent Control Board now follows below on Salesforce org. Step4: Create Adapter Agent SOAP

Fill name, choose Type =Agent Soap, Direction= outbound, choose XML payload, Operation= POST, fill username and password, and choose Adapter_instance.

Step 5: put the adapter into Interface.

Step 6: Callout v3 with Apex code.

skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl(); c.returnJSONComplete=true; c.actionDoIntegrate=true; c.isCreateMessage=true; String[] ids= new String[]{'0011x000015BR30AAG'}; skyvvasolutions.Iservices.invokeCalloutV3('IntegrationName','InterfaceName',ids,'SYNC',c);

Case 2

Handle API Message with Response Interface.

In this case, we just need to create a Response Interface using Soap Message Type. Pre requires

How to Handle API message with Response Interface? In this case, we just need Inbound Interface one more for do response. Because of Case 1, we have configuration some pre-required already. [su_box title="Note" box_color="#2a8af0" title_color="#000000"] Make sure that Message Type Reponses Interface is matching with payload Reponses of other request System or server.[/su_box] Step 1: Create inbound Interface and link Message Type Response

Step 2: Go to Interface Request and put the Response Interface in the field’s response Interface.

Step 3: Callout v3 with Apex code with Request Interface.

skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl(); c.returnJSONComplete=true; c.actionDoIntegrate=true; c.isCreateMessage=true; String[] ids= new String[]{'0011x000015BR30AAG'}; skyvvasolutions.Iservices.invokeCalloutV3('IntegrationName','InterfaceName',ids,'SYNC',c);

Case 3

Handler Over Fault Response.

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]Make sure that Adapter has fault response. [/su_box] Pre requires

Step1: create Inbound Interface as fault Interface.

Step 2: put fault interface in request interface.

Step 3: callout with apex code.

Case 4

Handle multiple different fault messages

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]When we use Multiple different fault messages, we don’t need to put fault Interface in the Request Interface because the field of fault Interface is a priority than related fault Interfaces. If we put Interface in field fault Interface, it will do only with field fault Interface and the related Interface will not do.[/su_box]. Pre-require: 

We have created a Fault Interface system error already so now we need to create two more fault Interfaces. Step1: Go to Integration and create Fault interfaces.

Step2: Put Outbound Interface Name in fault Interface of Every Response Interfaces.

We need to other Response fault Interface like the same way.

Step 3:  Go to Request Interface to see response fault Interfaces related.

Step4: callout with apex code. [su_box title="Note" box_color="#2a8af0" title_color="#000000"] Make sure that API has faults Message.[/su_box]

Open this article in the interactive viewer →