Fix it Fast Scenario: Table of Contents
Before You Begin
Purpose
In this section, you create a connector API in Oracle Mobile Cloud Service so that your mobile application can interact with an external web service. Connectors work with either SOAP or REST services to access external cloud services offered by other providers or assets, such as databases.
Connector APIs provide a bridge between your custom APIs and the enterprise services you want to access from those APIs. Using the REST and SOAP connector types, you create connector APIs for each data source that you want to access.
You define a connector API by entering info about the target resource, creating rules for the call parameters to "shape" the returned data so that it works well in a mobile context, and specifying security policies.
The result is a service that is exposed in the Custom Code API Catalog as a straightforward REST API.
Service developers can call this connector from their custom code just like they would any other API and they do not have to worry about tricky specifics like security policies and identity propagation.
The specifics of how the service is accessed and how the data is transmitted are dependent on the type of the connector protocol that you use. At the same time, the service benefits from the built-in security, diagnostics, and analytics features of Oracle Mobile Cloud Service.
Typically, to create a connector, you establish a connection to an external system, examine and select a set of possible interactions, and expose them in some way in a reusable form. In Oracle Mobile Cloud Service (MCS), this reusable form is an API that is modeled in a rich graphical user interface. At run time these connectors are invoked as APIs.
Step 1: Create a connector to a Right Now SOAP service
In this part of the tutorial, you create an MCS connector to support gathering data from a SOAP service. For this tutorial, the sample SOAP services that you will use are deployed to an Oracle Java Cloud Service, but of course the services might be deployed anywhere.
As with all development efforts, save often, and save a lot.
-
Log on to your MCS instance and click the Development tab.
-
In the Developer Portal, click the Connectors icon.
-
Click New Connector and then select SOAP from the drop-down list.
-
In the New SOAP Connection API dialog, enter the following values:
API Display Name:
SoapRightNow_xx
(where xx is your initials or unique value)API Name:
SoapRightNow_xx
(should be populated based on the value entered for the Display Name)WSDL URL:
https://javatrial8426-usoracletrial00546.java.us2.oraclecloudapps.com/McsBetaSoapApp-MockRightNowService-context-root/IncidentServicePort?WSDL
Short Description:
Exposes All Operations for the Incident Report.
Then click Create.
-
In the Configuration SOAP API wizard, click Save.
-
Click the Next arrow to navigate to the Port train stop and observe details about the service operations that are exposed.
-
Click the Next arrow to navigate to the Security settings.
-
By default there are no policies selected in the Security Configuration. For our purposes, do not add any policies.
Click Save and then the Next arrow to navigate to the next page.
-
In the Test page, scroll down to see all the resource methods that the service makes available.
-
Let's test a couple of the methods. First create a new incident in the database with the POST method.
Scroll down to the POST CreateIncident method.
In the Body, change the username to your name.
Expand the Authentication node and set the Mobile Backend to the one you created (
FIF_Technician_xx
) and specify the version (1.0
).Then click Test Endpoint.
-
The response status should show 200, and the body should contain an incident ID. Write it down (mine is 13).
-
Now that we can create a record using the connector and service, let's read the record with a GET method.
Scroll back up to the POST GetIncidentById method and expand it.
In the Body, set the IncidentId to be the value you just created (mine was 13).
Expand the Authentication node and set the Mobile Backend to the one you created (
FIF_Technician_xx
) and specify the version (1.0
).Then click Test Endpoint.
-
Again, you should see a response status of 200. If you look in the body, you should see the incident ID that you created and the username that you used.
-
If you want to test some more, scroll down and select the POST GetIncidentsByTechnician method.
In the Body, change the TechnicianEmailAddress and set it to
joe@fixit.com
.Expand the Authentication node and set the Mobile Backend to the one you created (
FIF_Technician_xx
) and specify the version (1.0
).Then click Test Endpoint.
-
You should see a Response Status: 200 and some incident reports. Scroll down to view them.
When finished click the Done button at the top right of the page.