Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Dhruval Patel
    Can I use custom API created in MCS for the project in MAF?
    Topic posted March 24, 2017 by Dhruval PatelBlue Ribbon: 750+ Points, last edited April 4, 2017 
    44 Views, 9 Comments
    Title:
    Can I use custom API created in MCS for the project in MAF?
    Summary:
    Can I use custom API created in MCS for the project in MAF?
    Content:

    Hello Chris,

    Comment

     

    • Chris Muir

      Hi Dhruval

      In answering your questions:

      "Do you think it should also publish the data same way?"

      Hard for me to say as I don't know what you're building, and what data you're using, and what format you require it in?  Context matters.  Generally speaking the guidelines I can suggest for exposing data for mobile & web apps:

      1) use MCS to trim the number of fields down to just the set that your application requires.  Generally speaking smaller payloads should be faster to transmit and process, though arguably this will not have any effect on latency attributed to distance.

      2) use JSON where you can, generally speaking JSON payloads have smaller payloads thanks to its less dense tag structures compared to XML, and as a result JSON parers tend to be faster too

      3) cache as much data in the mobile app as you can to stop unnecessary roundtrips, eliminating latency, & providing better app responsiveness

      Again these are all general rules, of which there are always exceptions.  What are you specifically concerned about in what the API is publishing?

      "when I try to search in the browser, I didn't get anything"

      I don't understand what you mean by this.  Are you asking me if I know about how to perform a query on http://api.sba.gov/geodata/city_links_for_state_of/ga.json?  No I don't, I've not seen these API before (it looks to be a USA website, I'm located in Australia), have they documented their APIs?  Do they have an API that supports search?  Again generally speaking we can't guess how a 3rd party REST API works, this needs to be documented somewhere.

      "Right now I am working on the Native App where I wanna use this custom API. Could you help me if you have knowledge about this?"

      I don't understand the question.  I have knowledge about native apps and custom APIs.  What are you specifically asking of me?  If you're asking me to tell you how to build a native app, I'm guessing you mean iOS or Android.  Are you skilled in Objective C or Swift for iOS, or Android Java?  Have you built apps on those two platforms before?  Are you asking me from scratch how to build an app on those platforms, or only specifically how to call a MCS custom API from iOS and Android?

      Dhruval, I think it's obvious here we're struggling with each other because of language differences.  I appreciate it might not be easy to translate questions into English so I understand your questions in their entirety, have patience with my questions and provide a lot more detail please.

      Thanks & regards,

      CM.

    • Dhruval Patel

      Thanks for the reply Chris.

      Let me make my question Simple.

      I have created custom API in MCS console. here I am fetching data from public API and manipulating result in Node.js and only necessary data I am passing to result. It works fine and providing the appropriate output.

      It works fine in MAX too.

      Now, I want to create Application using JDeveloper-MAF and here I want to use the Custome API created in MCS Console.

      Do you think I can use the same API I created in MCS Console?

    • Chris Muir

      Sure, MAF is capable of consuming MCS REST APIs.  You have a number of choices, including building a REST connector in MAF, or using the MCS MAF Utility, or CDM.  CDM is a good choice.  Please refer the MAF documentation for more information.


      CM.

    • Dhruval Patel

      Hi Chris,

      Below is the Custom API, I have created in MCS Console.

      https://development01-a419207.mobileenv.us2.oraclecloud.com:443/mobile/custom/DemoEditRestResult/all

      Could you send me documentation link to get this data in MAF application?

      I haven't found anything.

      Thanks,

      Dhruval

    • Chris Muir

      In the MAF User Guide: CDM: Creating the Client Data Model in a MAF Application

      Some Tutorials:

      Oracle JDeveloper 12c (12.1.3)Consuming and persisting REST/JSON services with Oracle MAF and the Client Data Model (CDM…

      Shaping MCS for Mobile Application Accelerator (MAX) applications  (The link name of this tutorial is automatically changed and wrong, this is a CDM tutorial)

      From MAF's perspective the MCS custom APIs are just another REST API, so CDM should be fine.  If you have questions around using CDM please post to the MAF forum: Oracle Mobile Application Framework

      CM.

    • Dhruval Patel

      Hi Chris,

      Thanks for the reply.

      I am following this link provided by you: Shaping MCS for Mobile Application Accelerator (MAX) applications

      Now when I tried to import provided package It throws following error.

      pastedImage_0.png

      Could you tell me what should be done?

      Thanks

      Dhruval

    • Chris Muir

      Hi Druhval

      Looks to be a privilege error? The MCS documentation says in order to create mobile users, realms (which is the privilege error you're specifically getting) and roles:

      https://docs.oracle.com/en/cloud/paas/mobile-cloud/mcsua/set-service.html#GUID-1D405C42-5BC1-4AB1-B5E1-CEE4AAAB5DD1

      As such does your user meet the requirements for setting up realms? Does it have these roles?

      Regards,


      CM.

    • Dhruval Patel

      Hi Chris,

      I have assigned almost all roles except following 5 roles. With the same configuration, another account is allowing to create Realm, But not mine.

      pastedImage_0.png

      Best,

      Dhruval

    • Chris Muir

      Understood but you need to answer my explicit question.  Are the roles mentioned actually in your selected roles?

      By the by I'm not able to give you further support on this on these forums, can you please lodge an SR with Oracle Support so they can work with you to resolve this.

      CM.