Stage 1 - creating the direct connection integration

With the preparation complete, we can focus on the creation of the integration, which means defining the connections to receive the test call from SoapUI and to call Mockable, for the outbound service as well as the integration itself.

Defining the connections in ICS

Like in the previous chapter, we need to create SOAP connectors; this time we will create two: one that will be called by SoapUI, and a second to call Mockable.io.

As before, navigate into the Connections part of the Designer and create a SOAP connection with the following details:

Property

Value

Connection Name

FlightSitRep_Ch3

Identifier

This will be proposed based on the connection name and there is no need to change it unless you would like an alternate name

Connection Role

Accept the defaults of Trigger and Invoke

Description

This receives FlightStatusUpdate objects as a SOAP service.

Email Address

Your e-mail address

WSDL URL | Connection Properties

Tick Upload File, then use the File selection to upload the ICSBook-FlightProgress-Source WSDL.

Close with the OK button

Security Policy | Credentials

Set Security Policy to No Security Policy. Close the dialog with the OK button

Once the fields are complete, use the Test button at the top of the page to validate the connection configuration; the percentage complete should reach 100% at this point. Click the Save and Exit Connection button.

Now we repeat this to create the second connector with the following details:

Property

Value

Connection Name

ReceiveFlightStatusUpdate_Ch3

Identifier

This will be proposed based on the connection name and there is no need to change it unless you would like an alternate name.

Connection Role

Accept the defaults of Trigger and Invoke

Description

Receive flight status update information within the integration and pass it to the Mockable.io target

Email Address

Your e-mail address.

WSDL URL | Connection Properties

Tick Upload File, then use the File selection to upload the ICSBook-FlightProgress-Target WSDL.

Close with the OK button

Security Policy | Credentials

Set Security Policy to No Security Policy. Close the dialog with the OK Button

We should now have two connections successfully created. So now we can navigate to the Integrations part of the Designer and create the integration. This process is very similar to the integration created in Chapter 2, Integrating Our First Two Applications, with one key difference-as we have defined both SOAP connections in the WSDL to be one-way (so no return result or fault definition), we will only see a one-directional flow. Click the Create New Integration button, and select the Basic Map Data pattern. Now we can complete the creation of the integration with the following details:

Property

Value

Integration name

FlightStatusUpdateDirect_Ch3

Identifier

This will be proposed based on the connection name and there is no need to change it unless you would like an alternate name.

Connection Role

Accept the defaults of Trigger and I nvoke

Version

01.00.0000

Package Name

ics.book.ch3

Description

This integration demonstrates point-to-point connectivity for the FlightStatusUpdate.

With the basic details for the integration completed, we can now drag and drop our connections from the connector palette. For the Source side, we want to drop the FlightSitRep_Ch3 connector. With the icon displayed, we can then proceed to edit the details of the connector to use. The Source and Trigger spots are as you may remember tabbed panels, and can be navigated through using the Next and Back buttons. But we need to complete the following information:

Tab

Question

Action

Basic Info

Call your endpoint field?

To keep it simple, call it Source.

What does this end point do?

Add the description: receives the flight status update from an external service.

Operations

Selected Port Type

As we only have a single operation in the WSDL, this tab will not offer any options.

Selected Operation

 

Request Object

 

Summary

WSDL URL

As we only have a single operation in the WSDL, this tab will not offer any options. But should reflect the selected connector information.

Selected Port Type

 

Cloud Operation

 

Message Exchange Pattern

 

We can now define the other end of the integration by dropping the connector ReceiveFlightStatus_Ch3 onto the Invoke target. The resultant dialog can be completed with the following information:

Tab

Question

Action

Basic Info

Call your endpoint field?

To keep it simple, call it Target.

What does this end point do?

Add the description: receives the flight status update from an internal source to then call out.

Operations

Selected Port Type

As we only have a single operation in the WSDL, this tab will not offer any options.

Selected Operation

 

Request Object

 

Summary

WSDL URL

As we only have a single operation in the WSDL, this tab will not offer any options. But should reflect the selected connector information.

Selected Port Type

 

Cloud Operation

 

Message Exchange Pattern

 

Now we need to complete the mapping. This will be a little more complex than in the previous chapter. But we start in the same way by selecting the mapping icon in the middle of the flow. Then we link the source and target elements by clicking and dragging the dot symbol using the following table to define the mapping:

Source

Target

id

FaFlightID

ident

ident

prefix

prefix

type

type

suffix

suffix

origin

origin

destination

destination

timeout

timeout

timeout

firstPositionTime

timestamp

timestamp

longitude

longitude

latitude

latitude

updateType

updateType

You will note we have deliberately mapped a source element to a destination element twice, as illustrated in the following screenshot, so the outbound data will have the same value in both elements:

Defining the connections in ICS

The diagram and table also show that we can map a single element of the source to more than one element on the target. To help differentiate the multiple integrations without bound endpoints, we are going to illustrate how to hardwire a target value.

The first step is to open up the specific mapping by clicking on ident in the target, which will show us the Build Mappings screen:

Defining the connections in ICS

To do this, we are going to modify the ident target field to have a prefixed string. You may recognize the expression in the statement; this shows the selected element from the source by providing an XSLT (XSL Transform). We are going to extend this to have a prefix of Direct-; to do this, select the edit statement (pencil) icon on the right. We will now be able to edit the schema.

On the right-hand side is the Source, and so on. Select the Mapping Components menu and open the String option in the collapsed tree. Scroll through the list until you see concat, then select this and drag and drop it onto the editor icon on the right-hand side.

Doing this will trigger a popup called Select Parameter. Now select the string1 field and click on OK. This will set the path into the position for the string1 field. To set the literal value, simply double-click on the string2 parameter and then change the value to the literal Direct-. Your statement should look like the following screenshot:

Defining the connections in ICS

As you can see, the expression inside the select clause looks vaguely Excel-like. Once done, select the Save button and close the dialog with the Close button. Back at the main mapper page, you want to press the Save button to be safe.

You may also note that some of the elements are prefixed with an asterisk. This denotes whether the element is declared as mandatory or not (indicated in the schemas within our WSDL files by the minimum number of occurrences attribute on an element definition) as you can see here:

<xs:element maxOccurs="1" minOccurs="0" name="heading" type="xs:int"/> 

We can confirm the mapping is as expected using the test option which can be accessed by the Test button. When you open the Test Mapper screen, you are presented with two large fields representing the input and output. As we have a WSDL and a schema, we can have some test values generated for us, by selecting the Generate Inputs button, which will populate the Inputs field. Alternatively, it is possible to paste in some input XML. Then by selecting the Execute button, the mapping process is performed and the Outputs field is populated. When you do this, you should notice the ident output is the input combined with the literal string. The following screenshot shows the outcome of generating and testing a mapping:

Defining the connections in ICS

If the input is not suitable, then you will see an error message in the output panel, such as:

There has been an error executing this map:  
<Line 10, Column 1>: XML-20210: (Fatal Error) Unexpected EOF. 

With the mapping complete, we can exit the mapper and set the Tracking. For this test case we would recommend tracking the Id element of the source.

Testing the integration

Having saved and tested the integration within the editor, we can make it Active using the button on the Integrations page. Once this process has completed, then we can get the URL for the service via the information icon. It will include the endpoint URL along the lines of https://icssandbox-xxxx.integration.us2.oraclecloud.com:443/integration/flowsvc/soap/TEST_SOAP_CH3/v01/?wsdl.

If you paste the URL into the toolbar of your browser, you will see the actual WSDL rather than invoke the service. To actually trigger the service you will need to remove ?wsdl from the URL (as this parameter is a common way to ask for the WSDL description to be returned). This path can be added to Mockable. Before running, also ensure that SoapUI includes the appropriate credentials, as you will have seen in the previous chapter. Once the service has been triggered, we can check the Monitoring page is showing when the service was triggered. But, most importantly, we can examine what has been received in Mockable. By selecting Request Inspector at the top of the screen, we will be presented with a screen showing what events have occurred, as follows:

Testing the integration

Within the Request Inspector , we can open up any of the requests and examine the content, which will show us the XML payload, as can be seen here:

Testing the integration

To see the XML payload, you will need to use the scroll bars, but you should be able observe their information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset