Tutorial

  1. Home
  2. Docs
  3. Tutorial
  4. 27. Overview of existing Skyvva adapters
  5. 27.5 How to create SOAP interface using the SOAP adapter?

27.5 How to create SOAP interface using the SOAP adapter?

Learning Objective:

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

  • Describe what SoapAdapter is.
  • Comfortably use SoapAdapter.

Introduction

User create Soap adapter to callout data from Skyvva – Salesforce to other Skyvva Salesforce instance.

What is SOAP Adapter?

SOAP defines the XML-based message format that applications use to communicate and inter-operate with each other over the Web. … Use the SOAP Adapter to help to create SOAPrequest messages and to interpret response messages.

Soap adapter is used for data processing of both direction. I,e Inbound and outbound.

Soap request-> Outbound interface

Soap response-> Inbound interface

What is soap Request and Response?

Represents the information being exchanged between 2 SOAP nodes. …

SOAPheader : A collection of one or more header blocks targeted at each SOAP receiver.

SOAP body : Contains the body of the message intended for the SOAP receiver. The interpretation and processing of SOAP body is defined by header blocks.

Setup

Step1: Create Adaptor

  • First Insert Adaptor Record By giving prefer Name and select Type = SOAP
  • Now Insert Properties:   If Need Authorization
  • Endpoint : “” , Insert Endpoint URL where Request will direct
  • Username : “”, Your Endservice UserName
  • Password : “”, Your Endservice Password
  • Authentication : “BASIC”

Step2: Create Metadata    

Now , Insert METADATA record By giving prefer details .

Here we are creating metadata for message type. Metdata providers  are  plugins that do the actual metadata extraction from  files. Metadata Provider tell the data processing layer of lib md which metadata fields (types) they can extract.

In Skyvva, when we create metadata, Name filed is only mandory field. On MetaData the Name cannot be duplicate.

Step3: Create Istructure repository

The term Repository is  in fact to store data and structure of a message. The purpose of Istructure is An Interface for a structure that contains the metadata of a structure.

Step4: Create Message Type

Now Create Message Types for IStructure Repository. Free define message type is a type and structure definition which is store in Repository. The message type can be resided in a WSDL, in SAP IDoc, SAP Bapi, etc… It can be stored in a file in csv, xml or other format.

For the Message Type , you have to use our defined Structure Defined Structure .

{
„SOAP_Service“: { //TYPE WILL BE : „WSDL Service“
„SOAP_Request“: { //SOAP_Request TYPE WILL BE : „WSDL Request“
„SOAP_URLPARAM“: { //TYPE WILL BE : „WSDL URL Parameter“
„SOAP_URL_PATH“: { // TYPE WILL BE : „WSDL Path Parameter“ : This will use in to build Query path of Endpoint URL
„Phone“: „“,
„Name“: „“
},
„SOAP_URL_QUERY“: { //TYPE WILL BE : „WSDL Query Parameter“ : This will use in to build Query path of Endpoint URL
„Phone“: „“,
„Name“: „“
}
},
„SOAP_Header“: { //TYPE WILL BE : „WSDL Header“ : This is just of identify not need to include in building of request or response
//Hear will be Actual Object which we suppose to insert in header of Request : Must be start by Object
„Account_Header“: {
„Name_Header“: „“,
„Phone_Header“: „“,
„Contact_Header“: {
„LastName_Header“: „“,
„Phone_Header“: „“,
„Fax_Header“: „“
}
}
},
„SOAP_Body“: { //TYPE WILL BE : „WSDL Body“ : This is just of identify not need to include in building of request or response
//Hear will be Actual Object which we suppose to insert in Body of Request : Must be start by Object
„Account“: {
„Name“: „“,
„Phone“: „“,
„Contact“: {
„LastName“: „“,
„Phone“: „“,
„Fax“: „“
}
}
}
},
„SOAP_Response“: { //TYPE WILL BE : „WSDL Response“
„SOAP_Header“: { //TYPE WILL BE : „WSDL Header“ : This is just of identify not need to include in building of request or response
//Hear will be Actual Object which we suppose to insert in Body of Response : Must be start by Object
„Account_Header“: {
„Name_Header“: „“,
„Phone_Header“: „“,
„Contact_Header“: {
„LastName_Header“: „“,
„Phone_Header“: „“,
„Fax_Header“: „“
}
}
},
„SOAP_Body“: { //TYPE WILL BE : „WSDL Body“ : This is just of identify not need to include in building of request or response
//Hear will be Actual Object which we suppose to insert in Body of Response : Must be start by Object
„Account“: {
„Name“: „“,
„Phone“: „“,
„Contact“: {
„LastName“: „“,
„Phone“: „“,
„Fax“: „“
}
}
}
}
}
}

  • Go to you Istructure repository and click on open editor button.

  • Select file type as JSON and give input to open text box as below:

Click on save button and check created massage type.

Note: Please check the type of your msg type. it should be same as shown in screen.

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

  •  Link adaptor we created earlier
  • Max Number of Retry (This means number of time should we retry if request fails first time).

Step6. Create Interface (Inbound/Outbound). Refer tutorial to create Interface.(How to create Interface?)

6.1 Create outbound Interface for request

Must fill this fields of Outbound Interface :

1.     Outbound Adaptor : 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 need to be insert and query should always include all fields we have mapped or going to map.

7.     Map Fields

Scroll down the page to the mapping section.

Target object Istructure is shown as tree structure. As we use JSON data to create message type, Istructure should display in three portion in

Request

⇓⇒ URL

Header

Body

So , when we get response and we will get both header and body so based on mapping we will perform DML operation for the data we got in response.

 

Now callout the data with developer console.

Go to developer console and enter this code to Execute Anonymous window.

skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl();
c.returnXML=true;
c.returnListRecord=true;
c.isCreateMessage=true;
String[] ids= new String[]{‚0016F000033uIHKQA2‘};
skyvvasolutions.CallOutResponse r = skyvvasolutions.Iservices.invokeCallout2(‚SOAP INTEGRATION‘,’SOAP REQUEST‘,ids,’SYNC‘,c);

Here In ids We have to insert Record id of Target Object and  first parameter in method should pass Integration Name and second will be the interface name as we have here

Integration Name = ‚SOAP INTEGRATION‘

Interface Name = ‚SOAP REQUEST‘

Execute the callout and check the result on message monitoring.

Go to Integration detail page -> click on Messages
Click on search button on message monitoring page and check the result.

 

6.2 Create inbound Interface for response

We must fill this fields ..

  • Inbound Adaptor : Select we created earlier
  • Metadata Provider : Select we created earlier
  • IStructure Repository : Select created iStructure Repo.
  • MessageTypes : Select MessageType (Selected MsgType TYPE should always be SOAP RESPONSE)
  • Source/Target Name :  Select Any Object.

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

How to link request and response Interface?

Follow the given step to link request and response interface.

  1. Go to outbound interface. Scroll down the page till outbound setup section.
  2. Edit the response interface field and select inbound interface id.
  3. Save the changes.

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

Create foreign key to link account and contact object.

Save the mapping.

  • To get response from endpoint you should have data at endpoint (Soap api which you called)

For example if you have data like:

  • Now callout the data with developer console.

Go to developer console and enter this code to Execute Anonymous window.

Go to developer console and enter this code to Execute Anonymous window.

skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl();
c.returnXML=true;
c.returnListRecord=true;
c.isCreateMessage=true;
String[] ids= new String[]{‚0016F000033uIHKQA2‘};
skyvvasolutions.CallOutResponse r = skyvvasolutions.Iservices.invokeCallout2(‚SOAP INTEGRATION‘,’SOAP_RESPONSE‘,ids,’SYNC‘,c);

Here In ids We have to insert Record id of Target Object and  first parameter in method should pass Integration Name and second will be the interface name as we have here

Integration Name = ‚SOAP INTEGRATION‘

Interface Name = ‚SOAP_RESPONSE‘

  • Execute the callout and check the result on message monitoring.
  • Go to Integration detail page -> click on Messages

 

 

Was this article helpful to you? Yes No

How can we help?