SK SKYVVA Documentation

2. How to create SOAP interface using the Agent SOAP Adapter?

Introduction

In this tutorial, we will learn how to use Agent SOAP Adapter to callout data from salesforce to other systems. There are several features to callout with this adapter, like without response messages, response messages, fault messages, attribute, and copy nodes. Agent SOAP adapter work with both processing modes, such as synchronous and Asynchronous.

I.  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.

Go to setup => Search 'Remote site setting'  => click it => click new Remote site. Here is an example. Remote site= Url +forward port   Example : http://3.122.44.62 + :9095 .

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: checking a cache monitor in the Agent control board. After we linked the adapter with the interface, we need to check the cache monitor to ensure that Adapter, Integration, Interface group, Interface, Ichain, mapping, or workflow that we set on an interface is cache retrieved.

If we got status false of object name we need to click Synchronize or Push button Cache to make cache retrieve properties.

Step 7: 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);

II.  Handle API Message with Response Interface.

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

How to Handle API message with Response Interface? In this case, we need Inbound Interface one more to make a 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] Step1: 

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

Step 3: Checking cache like above to ensure that Adapter, Integration, Interface group, Interface, Ichain, mapping, or workflow that we set on an interface is cache retrieved. Step 4: 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);

III: Handler Over Fault Response.

In this case, we use two Interfaces like Inbound Interface for Response and Outbound Interface for Request. The process of these cases is to put the Response Interface, which is fault Message Type, into the Request Interface. Example. We have an outbound Interface and put the fault Interface with the message Type fault_SystemError in the outbound Interface. When the callout V3 is met  System Error, the Inbound Interface will respond to the fault message to tell the user that the Callout has a problem with the system Error. [su_box title="Note" box_color="#2a8af0" title_color="#000000"]Make sure that Adapter has fault response. [/su_box] Pre requires

Step1: Create an Inbound Interface as fault Interface.

Step 2: Put fault interface in request interface.

Step 3: Checking cache to ensure that Adapter, Integration, Interface group, Interface, Ichain, mapping, or workflow that we set on an interface is cache retrieved. Step 4: Callout with apex code.

IV. Handle multiple different fault messages

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]When we use Multiple different fault messages, we do not 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 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 in the same way.

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

Step 4: Checking cache to ensure that Adapter, Integration, Interface group, Interface, Ichain, mapping, or workflow that we set on an interface is cache retrieved. Step 5:  Callout with apex code. [su_box title="Note" box_color="#2a8af0" title_color="#000000"] Make sure that API has faults Message.[/su_box]

V. callout with feature copy node.

We use copy nodes to support the requirement for outbound mapping when a node is needed a certain number of times. In this case, We do not need from the source side a sObject instance to create the occurrences of the target node. We can use the data inside the same sObject that occurs multiple times. For example, e.g., We have two types of addresses in the account, like billing and shipping address. We need to create the target node only two times and not n-times as the sObject instance. In this case, we can use the so-called ‘Copy Node’ function to copy the target node two, three, or as many times as you need to have on the target side. Pre-require: 

Step 1: create Integration and outbound Interface.

To set a copy node, we click the left mouse on a node that we need to copy and then click copy node.

Step2: Go to the Agent control board to create an Agent soap adapter.

Step 3: link the adapter to the Interface.

Step 4: checking cache to ensure that Adapter, Integration, Interface group, Interface, Ichain, mapping, or workflow that we set on an interface is cache retrieved. Step 5:  callout with apex code.

Step 6: Go to message monitor to check the result.

Summary Finally, we have learned how to use Agent soap to call out other systems with many features shown above, such as Callout with the response and without response, fault message, attribute, and copy node. This Agent soap Adapter is useful for users who want to process with internal and external systems.

Open this article in the interactive viewer →