SOAP API Scenario in RO2
SOAP API Scenario in RO2
Objec ve:
In the RO2 Server, a scenario should be built which consists of s mula ng a SOAP-API that uses the SOAP adapter as well as the WSDL language, through
which we can send requests and receive responses.
What to do:
In their own namespace, everyone must implement in a personalized way the scenario that sends the ISO code / name of the country (request) and in its
response receives the following series of informa on of this country (response).
Diagrams:
And so on…
Auxiliary resources:
WebService URL: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso
WSDL URL: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?wsdl
Tes ng:
The project also requires the monitoring of the transmission process by monitoring the messages, to check the success of the messages.
Steps for solving the exercise:
A web service is a server that runs on the web. It exposes certain application logic to the outside world, making it callable over the Internet using HTTP requests.
(For more information click the link: https://learning.dataaccess.com/courses/soap-web-services/).
• 2 business components that will serve as the sending component and the receiving component,
• 2 communication channels, respectively sender and receiver, as well as at the end,
• Integration Flow that will connect all objects and possible configurations.
2. Create a new namespace within which we will store all the objects we will create:
Mapping object with the name "MM_Country_WebService_Request", it will be used for arrowing requests in sending.
After we have reserved it, we insert the external message with the name "FullCountryInfoSoapRequest", with occurrence 1..1.
at the end, we make the mapping with the connections as in the figure:
5. Create the Message Mapping object with the name "MM_Country_WebService_Response", it will be used for mapping requests in the response.
After we have reserved it, we insert the external message with the name "FullCountryInfoSoapResponse", with occurrence 1..1.
at the end, we make the mapping with the connections as in the figure:
6. Next, we create the object of the Service Interface type that will send the request, naming it: "SI_Country_WebService_S2S_Out", we reserve the object.
For this object we choose to send the request, so for the category option we choose the value "Outbound" and for the mode option we choose "Synchronous".
Also, for both Request and Response roles, we choose the External Message type, and their name as in the figure below:
7. Similar to the above object, we create the Service Interface type object that will bring the information by naming it:
"SI_Country_WebService_S2S_In", we reserve the created object.
It is similar for this object as we choose to return the response, for the category option we choose the value "Inbound" and for the mode option we choose "Synchronous".
Also, for both Request and Response roles, we choose the External Message type, and their name as in the figure below:
8. Next, we now have the creation of Operation Mapping with the name: "OM_Country_WebService", which connects all the objects designed so far:
Ne objektin e rezervuar shtojme objektet e Service interface dhe Message Mapping sipas drejtimeve te komunikimit. Theksojme faktin se Tab-et
Request dhe Response shfaqen vetem pasi te kemi bere nje rezervim fillestar pas shtimit te Service interface-ve.
9. Let's continue now with the configurations that we will make in the Integration Directory.
Names and types of objects that will be created in ESR and ID
Enterprise Service Repository Objects Integration Directory Objects
ED_ Xml_Country External Definition BC_WS_S2S_Sender Sender Business Component
MM_Country_WebService_Request Request Message Mapping BC_WS_S2S_Receiver Receiver Business Component
MM_Country_WebService_Response Request Message Mapping CC_WS_S2S_Sender Sender Comm. Channel
SI_Country_WebService_S2S_Out Outbound Service Interface CC_WS_S2S_Receiver Sender Comm. Channel
SI_Country_WebService_S2S_In Inbound Service Interface IF_WS_S2S_Country Integration Flow (Configuration Scenario)
OM_Country_WebService Operating Mapping Namespace: http://realcore.de/RC/IR/Course/SOAP2SOAP
10. We first create the SOAP2SOAP folder, within which we will continue the configurations. Then we start with the 2 components, first the sender named:
BC_WS_S2S_Sender. We reserve and activate the component.
We repeat the same process for the second component with the name: BC_WS_S2S_Receiver.
11. We continue with the creation of communication channels. We name the first one: CC_WS_S2S_Sender during creation and
connect it to the Sender component and the Soap adapter SAP Basis 7.5 (SOAP 1.1).
Let's continue with the configurations: In the Advanced tab, activate the "Set Adapter-Specific Message Attribute" checkbox, in Quality of service: select "Best Effort"
(since we are waiting for a response from the receiving system):
We repeat the actions to create the receiver channel, with the name: CC_WS_S2S_Receiver
We make sure to select the Receiver radio button, and then in the Target URL we put our address that leads to the wsdl file, which was:
http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?wsdl
To complete the Soap action option, we first need to open the other address that shows all web services: DataFlex Web Service for Country information
with url: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso then we choose to activate the desired service, from where we copy the SOA
P Envelope address, as in the figure below. It is precisely this address that should be added to the SOAP action option. We don't need another option.
Save the changes and activate.
12. Now it's the turn to create the ICO (Integrated configuration) where we first give our Sender component, the Outbound Service Interface and the namespace name.
We do the creation and continue the completion with the options related to inbound and outbound processing: the sender communication channel, then we give the Recei
ver component, then the Service interface Inbound, namespace, the name and version of the Software component, Operation Mapping. Likewise, in
Outbound we give the Receiver Channel, at the end in the Advanced Processing tab we make the choices of "store" and "log" as in the figure
With the completion of these steps, our interface is ready. We have reached the stage when we can test and use this interface. For this we need the url addre
ss that enables the request to the interface that we have created in order to get the right answer.
13. We will follow the following steps in the Postman / SOAPUI application:
Create a new HTTP project. In the created request, we select the POST method, and in Url we give the address:
http://ro2.realcore.local:50000/XISOAPAdapter/MessageServlet?Channel=:BC_WS_S2S_Sender:CC_WS_S2S_Sender
14. In the <body> section, add the xml code of the request as in the figure
15. Select the authorization <basic> and give the username and password (we could also have an API Key, but in our case it is the RO2 credentials). Fill
in the following options in the Headers section: Content-type text/xml; charset=utf-8. Host: webservices.oorsprong.org,SOAPAction: "FullCountryInfo" .