SK SKYVVA Documentation

27.5 How to create SOAP interface using the SOAP adapter?

Learning Objective: After completing this unit, you’ll be able to:

Introduction

SOAP is the Simple Object Access Protocol, a messaging standard defined by the World Wide Web Consortium and its member editors. SOAP uses an XML data format to declare its request and response messages. In SKyvva, we have a SOAP Adapter used for data processing of both directions, like Inbound and outbound.  We use SOAP Adapter to Integrate data between Salesforce to systems that have SOAP API. As we knew that SOAP has Request, Response, and Fault Response, there is control by API Structure and different objectives and structures. SOAP Service 

Soap request-> Outbound interface

As we have Four elements in Request:

Soap response-> Inbound interface There are three elements under Response:

1.1 Header 1.2 Body Fault Response -> Inbound interface There are two elements under Fault Response:

1.1 Body

SOAP Template using in SKYvva. We have SOAP Service that types WSDL Service with three children: Request, Response, and Fault Response. For those children, they have different types like Request is WSDL Request Type, Response is WSDL Response, and Fault Response is WSDL Fault Type.

In Request Message Type is Type WSDL Request, and It has several elements like First is SOAP Header have type WSDL Header that contains Sessionheader, and in Session header, it has SessionID. About Session Header and SessionID, we can put type plaint Structure or none. Seconds is URL Query Parameter has type WSDL Query Parameter. The third is HTTP Header that has the type HTTP Header. The fourth is SOAP Body that has type WSDL Body that contains Business data which type is Plaint Structure or none. See the picture below.

In Response Message Type is the WSDL Response type. It has one element that is the Envelope message type has a Type WSDL Envelope. In Envelop has Header, type WSDL Header and Body has WSDL Body containing Business data Message Type with Plain structure type or none. See the picture below.

In Fault Response Message Type is Type WSDL Fault and it contains two elements such as Envelope has Type WSDL Envelope. In Envelop Message Type has Body that is WSDL Body type and under the Body is Business Message Type that is a plain structure or none type.  see the picture below.

Setup:

Step1: Create an Adapter

Example:

We can handle if the business has URL Query Parameter and HTTP Header URL Query Parameter : ?pCity={!City}&pCountry={!Country} HTTP Header : Content-Type:Application/xml|{!LastName}:{!FirstName}

Step2: Create Metadata

Now, Insert the METADATA record By giving prefer details. In Skyvva, when we create metadata, the Name field is only a mandatory field. On MetaData the Name cannot be duplicated.

Step3: Create Istructure repository

Step4: Create Message Type

For the Message Type, you have to use our defined Structure Defined Structure. -Here is SOAP template created by Message Type for build xml payload:

Message Type Name TYPE

MessageType: Google SOAP Service WSDL Service

MessageType: Request WSDL Request

MessageType : URL Query Parameter WSDL URL Query Parameter

MessageType : SOAP Header WSDL Header

MessageType : HTTP Header HTTP Header

MessageType: SOAP Body WSDL Body

MessageType : Response WSDL Response

MessageType : Envelope WSDL Envelope

MessageType : SOAP Header WSDL Header

MessageType : SOAP Body WSDL Body

MessageType : Fault WSDL Fault

MessageType : Envelope WSDL Envelope

MessageType : SOAP Body WSDL Body

Here's a sample SOAP Message Type we can use by using the Import Metadata provider function. SOAPVersion2_skyvvasolutions__MetaDataProvider__c (21) Step2: Create message type for SOAP template Manual  create message type for SOAP template

Once we Save this Message type is created.

Now create all child message types. Create IStructure for it and Message field Entry in each message type.

Step5. Create Integration. Refer  tutorial (How to create integration.)

Step6. Create Interface (Inbound/Outbound). Refer tutorial to create Interface. (How to create Interface?) Create outbound Interface for request Must fill this fields of Outbound Interface : 1.     Outbound Adapter: Select we created earlier

2.     Metadata Provider: Select we created earlier

3.     IStructure Repository: Select created iStructure Repo.

4.     MessageTypes: Select MessageType (Selected MsgType TYPE should always be WSDL REQUEST)

5.     Source/Target Name:  Select Any Object

6.     Query: Query needs to be inserted and the query should always include all fields we have mapped or going to map.

7.     Map Fields

Do mapping for Request. Here's Example.

Create an inbound Interface for response

We must fill these fields:

Do mapping for a response Interface. Here's an example of mapping

We have to link this inbound interface with our outbound interface which is a responsive interface.

How to link request and response Interface?

Follow the given step to link the request and response interface.

Now go to our inbound interface -> scroll down the page to mapping section and map the fields with Skyvva mapping tool.

skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl(); c.returnJSONComplete=true; c.actionDoIntegrate=true; c.isCreateMessage=true; String[] ids= new String[]{'0011x00001FPNWBAA5'}; //ID of sObject Listresult=skyvvasolutions.Iservices.invokeCalloutV3('SOAP-Integration','Request',ids,'SYNC',c); Here In ids, We have to insert Record id of Target Object and  first parameter in the method should pass Integration Name and second will be the interface name as we have here Integration Name = 'SOAP INTEGRATION' Interface Name = 'SOAP_RESPONSE' Here's Example

Follow this link #article/97-enhancement-handling-fault-message-with-v3 to learn more about Fault SOAP.

Open this article in the interactive viewer →