Browse Category by MCS
View Post

Oracle MAX: Building my first application (Part 1): Custom API design

In the last release of Oracle Mobile Cloud Service, Oracle Mobile Application Accelerator (Oracle MAX) and Location Services were released. In my first technical post about MCS 2.0 I am going to focus on Oracle MAX, the new tool that allows us to create applications without coding, and that will enable business users, and people that doesn’t know about programming, to build applications easily.

This is a 2 part post where you can find:

Before that any user can create an application we have to design correctly our Custom API.

Oracle MAX uses business object, so first we need to define schemas for the endpoints.

In this quick example, in our Custom API we are going to have 2 endpoints

/posts that will return a list of all posts, and
/post/id that will give us the information of the post.

Now that we have our endpoints create we have to create schemas for them.
In the left hand side menu, we have to click on ‘Schema’, and if we don’t have any schema yet, click on ‘New Schema’ button.
The first one is Post schema.
This is the base schema for the post object. Now we need to create a schema for every endpoint. 
For /posts endpints we will have getPosts


And for /posts/id endpoints we are going to create getPost schema.
The first step is completed. Now we need to associate the schema to each endpoints and create Mock Data in the responses to each endpoint.
At the moment it is mandatory, and if you don’t have mock data you will not be able to create lists in the application. I would like to thanks Denis Tyrell and Laura Akel for their help with this issue.
For each endpoint we have to click on methods.
Then in responses we have to select the schema that corresponds to the endpoint by adding new Media Type.
And also adding mock data in examples tab.
Our first endpoints is finished, and our second endpoints will looks like:

The last step is to publish the API, because we will not be able to consume it if it is not published.
In API menu, right click on the desired API and click on Publish.
I am not going to implement the APIs as you cna check other posts like Post 1, Post 2, Post 3 or OTN Article. Implementation and design should be done by someone with development skills,
In the next post we will build the application itself and this step can be done by anyone, as the application development is based on wizards and we don’t have to write any line of code.
    View Post

    Oracle MAF: Oracle MCS as authentication provider

    An usual requirement when working with Oracle Mobile Application Framework and Oracle Mobile Cloud Service is implement the login against Oracle MCS.
    In this post I am going to show you how to configure Oracle MCS as an authentication provider in Oracle MAF.

    • Creating a Realm
    A realm is a security context for a ser of users. We can have only one realm for each Mobile Backend, but we can have multiple Mobile Backend using the same realm.
    Using one or more realm in MCS will depend on what users we will like to give access to our application.
    Under Applications, we can find Mobile User Management. By default there is one realm named ‘default’, but we can create a new one by clicking on ‘New Realm’ button.
    In the realm we can find some user information by default altough we can add more properties.

    • Create and configure a Mobile Backend
    A Mobile Backend (MBE) is the gateway to Mobile Cloud Service. If we want to access any available resource from MCS, for example an API, we have to do it though an MBE.

    We can find Mobile Backends option under Applications menu option.

    Click on ‘New Mobile Backend’ to create a new one.

    Once you have created the MBE head to Users option and click on ‘Change user realm’, by default the MBE has a realm but in this case we need to set the new realm we have just created. This is not the case, but we can also set a default realm for every new created MBE.

    In the popup we can select any existing realm.

    After that, as there is no users in the realm you can add them by clicking on ‘Add New User’ button.

    You will receive an email to the email address you used to register the user.
    • Configuring a MAF Application.
    The last step is to configure the MAF application. Here is a couple of things that we have to do.
    First we need to create a secured page. We can do it in maf-feature.xml
    The last thing is to configure the login server.
    To do this, we need to open maf-aplication.xml. We can find the file in ‘Application Resources’ under descriptors/ADF META-INF folder.
    Click on the add button.

    In the popup we have to select HTTP Basic as Authentication type and set a name to the connection.

    In HTTP Basic tab we need to configure login and logout URLs.
    To build this URLs we need to know the base URL, and add to it at the end ‘/mobile/platform/users/login’ in Login URL and “/mobile/platform/users/logout” in Logout URL.
    We can check the base URL in MBE Settings menu option.

    The last step in the cofiguration is to add a custom header. The header name will be ‘Oracle-MobileBackend-ID’ and the value can be also found in MBE Settings menu option.

    We just have to execute the application. As soon as we do it, the login page will appear.
    If we set the right credentials we will access our secured page.
    But if we enter wrong credentials we will se a’Invalid username or password.’ error message.



    OTN Tech Article: PCS, MCS and MAF Integration

    I have just published my first OTN Tech Article where I present a use case that demonstrates how Oracle Process Cloud Service (Oracle PCS), Oracle Mobile Cloud Service (Oracle MCS) and Oracle Mobile Application Framework (Oracle MAF) can be use together to expose  an Oracle PCS process instance as a web service and consume it from an external system, web application or mobile application.


    Oracle Process Cloud Service is a Platform as a Service (PaaS) provided by Oracle Cloud, allows you to rapidly design, automate, and manage business processes in the cloud.


    Oracle Mobile Cloud Service is Oracle’s Mobile Backend as a Service (MBaaS) and enables companies to create and deploy scalable, robust, and secure mobile applications quickly and easily.


    Oracle Mobile Application Framework is a hybrid mobile framework that provides a visual and declarative development experience for the rapid development of multi-platform applications

    You can check the full article here: https://community.oracle.com/docs/DOC-996644

    Oracle Mobile Cloud Service New version has been released

    New Oracle Mobile Cloud Service version has been released where we can find, a redisign of the application and some improvements that we were missing the the previous version (1.0). This new version 1.1 matches 16.1.1

    if you want to know more about Oracle Mobile Cloud Service you can check my previous post: Oracle Mobile Cloud Service overview

    The first changes that we can see is the design of the application. In the new version the menu is on the left hand side and you can collapse it. You can also change between environments with the combo box in the header of the application.

    Another change we find is in Mobile Backend authentication. In the previous version we were able to use HTTP Basic, but in the new version we can configure our Mobile Backend to use OAuth authentication.

    Oracle said that more connectors will come in future releases. Until now we were able to integrate REST and SOAP web services, now we can integrate our Integration Cloud Service instance thanks to the new connector.

    Analytics is other feature that has changed, nwo we can create custom reports so we can avoid to select the filters every time we want to see them.

    Other new features that were introduced are:

    • We can now integrate out .NET and JavaScript applications thanks to the new SDKs.
    • We can configure some static values when deploying between environments in our Mobile Cloud Service instance by editing a properties file.
    • We can also export and import any artifact we create so the migration between instances is easier.
    If you want to know more about the new version you can check: What’s new in Oracle Mobile Cloud Service

    MCS: Calling SOAP connector bypassing XML/JSON translator

    In the MCS project we are working we have to create some SOAP Connectors to integrate with Siebel. A great thing of MCS is that although we are going to consume a SOAP web service, the XML payload is automatically translated into JSON. You can get more info in MCS Documentation.

    I would like to thank Oracle Mobile PM  team, specially Grant Ronald and Frédéric Desbiens for their great help and for sharing best practices about this issue.

    As soon as we create a SOAP Connector and try to test it we can see that the body we have to provide is a JSON.

    But there are some cases where the translator is not perfect. We had a problem with some services that had an XML structure like this:

    The translator seems not to add the  namespaces in the header therefore Siebel cannot parse the request.

    The solution is to send a XML instead of a JSON, bypassing the translator.
    We can test this in SOAP Connector tester. As we need the required XML, we can get it in any web service client tool like for example SoapUI.

    We also have to set “Content-Type: application/xml;charset:UTF-8” and “Accept: application/xml” as header parameters.

    If we test the Connector we can see that the web service call is working.

    How do we implement the Custom API to send a XML payload to the connector?
    The answer is to set the XML we want to send as the body of the request and set the header parameters we previously use to test the connector.

    But, is this the recommended approach? Yes it is, but instead of sending a String with the SOAP message it is more secure to send it as a JavaScript object.

    In order to implement this we have to follow some steps:

    1. Download and Install Node.js. link
    2. Install xml2js module.
    3. In this example test_rrs is the directory where the package.json file resides.

    4. Add xml2js as a dependency in package.json
    5. Moving to our javascript file, as I already stated before the first idea was to build the SOAP message as a string. This first image is the base implementation and we are going to make some changes to it.
    6. First we need to add var xml2js = require(‘xml2js’); at the top of our implementation.

      This is the tricky part, we need to create a JSON like this.
      ‘ $ ‘ means that we want to add attributes to the XML element.
      ‘ _ ‘ means that we want to have something inside that element.

      The last thing we have to do is to create a xml2js.Builder object and execute buildObject method using the json object we have just create. The result of this method is the body we are going to send.
    After the implementation is done we just have to put everything inside the zip file and upload it to MCS.
    If you want to know more about xml2js click here.