MAF and REST

Does anyone know the requirements and limits for the RESTServiceAdapter?

I spent the last day or so to study different options and seem to have reduced in the absence of Content-Length in the response, or maybe connection: close

For example, a REST service that works returns the following raw http response

HTTP/1.1 200 OK

Access-Control-Allow-Origin: *.

Content-Type: application/json

Date: Tuesday, July 22, 2014 10:48:27 GMT

Content-Length: 225

{'ip': '122.109.131.63', 'country_code': "to THE", "country_name": "Australia", "region_code": "05", "region_name": 'South Australia', 'city': 'Adelaide', 'postal code': latitude '',' ':-34.0287, "longitude": 138.0986, ' metro_code ': '',' area_code' ":" "}

Conversely, a REST service that does not work will return the following raw http response

HTTP/1.1 200 OK

Date: Tuesday, July 22, 2014 10:56:02 GMT

Server:

Connection: close

Host: 192.168.0.4:8080

Content-Type: application/json

{'ip': '122.109.131.63', 'country_code': "to THE", "country_name": "Australia", "region_code": "05", "region_name": 'South Australia', 'city': 'Adelaide', 'postal code': latitude '',' ':-34.0287, "longitude": 138.0986, ' metro_code ': '',' area_code' ":" "}

The code I use is this and will display the string correctly for the first sample, but is empty in the second sample.

RestServiceAdapter restServiceAdapter = Model.createRestServiceAdapter ();

Claire each previously defined properties of the request, if any

restServiceAdapter.clearRequestProperties ();


Set the login name

restServiceAdapter.setConnectionName ("GeoIPOAG");


Specify the type of request

restServiceAdapter.setRequestType (RestServiceAdapter.REQUEST_TYPE_GET);    MESSAGE switching makes no difference, get the same results

Specify the number of attempts

restServiceAdapter.setRetryLimit (0);

ADDED to this to see that she had no effect - if not

restServiceAdapter.addRequestProperty("Connection","Keep-Alive");

restServiceAdapter.addRequestProperty ("Content-Type", "application/json");         Define what is recommended in the guide of dev MAF but has no effect

restServiceAdapter.addRequestProperty ("Accept", "application/json");                Define what is recommended in the guide of dev MAF but has no effect

Set the URI which is defined after the end point in the connections.xml.

The application's endpoint + defined URI

restServiceAdapter.setRequestURI("/json/122.109.131.63");

Run the SEND and RECEIVE operation

try {}

System.out.println ("\nInvoking Service REST on GET and the details are" + restServiceAdapter.getRequestURI ());

For a GET request, there is no payload

String answer = (restServiceAdapter.send(""));

System.out.println("\n**********************************************************************************************");

System.out.println ("\nResponse GET album was" + response);

System.out.println("\n**********************************************************************************************");

} catch (Exception e) {}

e.printStackTrace ();

}

Add this in case someone has this problem - the MAF for REST of treatment seems to require Content-Length. Without it, it will not process the answer - that is, the answer is «»

It is a bit of a pain if you have a REST service on the API Oracle Gateway what not will BE NOT Content-Length of back (except if you call another server as part of your policy).

Tags: Oracle Mobile

Similar Questions

  • A-team - MAF Persistence Framework - is available for the MAF and it is an approach recommended by Oracle for Application Data Sync?

    Hi OTN community.

    My query is on Oracle team Persistence framework (http://www.ateam-oracle.com/going-mobile-with-adf-implementing-data-caching-and-syncing-for-working-offline/).

    It is available for the MAF and it is an approach recommended by Oracle for the implementation of data synchronization?

    Can anyone please share their experience using this extension.

    We are currently reviewing the best approach for the implementation of data synchronization.

    Best regards

    Deepak

    See: persistence of the MAF Oracle for SQLite

    Frank

  • Some virtual machines have intermittent network connectivity problems and rest work correctly.

    Some virtual machines have intermittent network connectivity problems and rest work correctly. The VMs are in the same group of port and on a 4-node cluster. Physical network interface cards are appearing in vsphere client

    Please confirm if the issue has been resolved after you complete the steps.

  • [MAF - AMPA] Strange behavior of the MAF with REST service

    Hi MAF Experts.

    I just noticed that there is a strange behavior in my application of the MAF. The first loading of the page, amx:page does not make its contents (of REST). However if I kill the app and relaunch the app, content appears.

    Pattern:

    1. Start of the CRG App
    2. Opening of session
    3. Dashboard (the content is rendered)
    4. Go to any other aspect (lets say a list of products)
    5. Open product list (content do not get returned)
    6. Kill the MAF application
    7. Start of the CRG App
    8. Dashboard (the content is rendered)
    9. Go to the product list
    10. List of products (content gets rendered)

    I put a few breakpoints on EntityCRUDService and RestPersistenceManager.

    So far it return the list of entities and display the correct data (from watches in debug mode)

    Last thing I noticed is the red color below. She defined the EntityList with the new value of REST (This displays a correct value).

    TaskExecutor.getInstance (.execute (isDoRemoteReadInBackground ())

    , () -> {

    Auto Sync all actions pending first, pass false for inBackground because

    We want to process actions pending before the reading distance

    getDataSynchManager (.synchronize (false));

    The list of entities < E > = executeRemoteFindAll();

    If (entities! = null)

    {

    When an error occurs (for example server is not available, the method returns the value zero)

    setEntityList (entities);

    }

    });

    Any suggestion?

    All the rest service are configured with AutoQuery = true in the persistence - mapping.xml

    See you soon,.

    Hendry

    Hendry,

    Thanks your testcase, I was able to understand the problem.

    It turns out that MAF 2.1 has problems dealing with the advanced way in which AMPA running background tasks with the help of a thread in all of features.

    We have slightly modified the implementation in AMPA to use one thread per function and now the update issue is resolved. I sent you a link to new construction.

    We will publish the new generation soon on GitHub so that others can benefit in the same solution.

    Steven Davelaar,

    Oracle Mobile A-team.

  • MAF: Using rest with JSON

    Hi all

    I use jdev 12.1.3

    While practicing the CRG, I am facing a problem with the help of rest with JSON response.

    I followed this: https://blogs.oracle.com/adf/entry/simple_get_operation_with_json

    A slight difference is that I already have a Restful services with JSON response I have hace created in Oracle Apex.

    Following the example, I followed the steps but when I open the application in the Android emulator after deployment, I don't get all the lines, I dropped the data as MAF List View control.

    I don't get all the lines and I am showing 0 in the first row.

    Please let me know what could be the problem.

    Kind regards

    KP

    See your json output you can't edit it directly to the employee object.

    First you must get the json object, then json for the elements array, then one by one, you must create the Employee object.

    In addition, you see 0 because for a PGE no integer, the default value is 0 because the data are not filled the json output.

    Try the code below and your question should get solved:

    answer = restServiceAdapter.send("");

    JSONObject jsonObj = new JSONObject (response);

    JSONArray empList = (JSONArray) jsonObj.get ('items');

    int size = empList.length ();

    ArrayList empArray = new ArrayList();

    for (int i = 0; i)

    try {}

    Employee emp = new Employee();

    JSONObject result = empList.getJSONObject (i);

    String empno = (String) result.get ("empno");

    Ename string = (String) result.get ("ename");

    emp.setEmpno (Integer.parseString (empno));

    emp.setEname (ename);

    empArray.add (emp);

    } catch (System.Exception e)

    {}

    Employee [] e = (Employee []) empArray.toArray (New Employee [empArray.size ()]);

    e return;

    Your method signature must be:

    public employee [] fetchEmpDetails()

    With the signature above you return an employee table which can be used for a list view.

    Let me know if it helps.

    Kind regards

    Deepak

  • Activity app and rest days

    I want to know where to put in a suggestion to apple for the ability to select 'Day of rest' for the purposes of the activity. The days where I work or go running, I'm fine with my current travel goals. My rest days (which are important for the recovery and avoid injury and I don't like to take it as it is and really want to get out and run, but I know that I shouldn't be) I do not have my goals of moving and it makes me feel worse to take a day of rest. He might be a target moving separate for the rest day, or to use throughout the week as goal a shot instead of every day, or something. Someone knows where to make suggestions to the developers?

    Hello

    You can suggest new features to Apple here:

    https://www.Apple.com/feedback/watch.html

  • vCOPs and REST API

    VCOPs currently allows the coming data via the REST API?

    VCOps currently allows its data available through the REST API?

    If this isn't the case, will be the version 6.0 have this feature?

    RV Ops 6.x see this thread:

    Integration of vCO and vCOps

  • CP8 and rest of the setting of the project

    How do you set timing on individual objects in CP8.  For example, I have a text caption that I have the slide number variable and I want him furn for the rest of the project.  I can't find anywhere to set timing on specific objects.  Where this feature is gone.  I don't want to copy some objects over and over.


    Hi Graysusan,

    Sync settings are in the "Timing" of the object Panel.

    Select the object on the stage and click the properties button in the toolbar. It will open the calendar with the properties panel Panel.

    Kind regards

    Alexis

  • Apex and restful Services

    What I have to install apex listener to use Restful Services.
    We are on apex 4.1 and use apex modplsql.
    I have to also install listener apex in order to use restful services or would it not just enougt to Update 4.1 in point 4.1.1 and I can continue to use apex 4.1.1 with modplsql.

    Thank you
    Kumar

    Hi Kumar,

    APEX listener 1.1 (including your 1.1.4 installation) has a different implementation for RESTful Web services. You can access the configuration using own configuration of the APEX listener ("' / listenerAdmin" ").
    The new RESTful implementation integrated at the APEX is provided with the new APEX 2 listener, which is still in the phase of early Adpoters. This is a patch for APEX 4.1 4.1 be able to use it as well. See the installation guide for the current version of EA for more details.
    Since the APEX 4.2 was released today, I would recommend to upgrade to this version instead of patch 4.1 if you have anything that would prevent you from upgrading. And I expect APEX earphone 2 will be released soon as well, even if it has not been an official announcement yet.

    -Udo

  • Opening, using Relocator and rest with my project structure

    I use Relocator to move my photos 'managed' Aperture library to be "referenced".  However, now I have to do a project at a time.  I can't get Relocator to work on multiple projects and maintain my project structure.  When I tried it, I put the subfolder 'project' format and the format of the name to "original file name.    It did not work as planned, he put each photo in its own folder.  So now in the format of subfolder 'custom name' and provide the name of the project.  This seems to be the only way to keep my existing structure.   My existing structure is the name of the event and the date, for example the Blizzard Dec 2008.    Any tips or suggestions?  I have pictures of 70 K to move! Going to take some time do this project!  Thanks in advance!

    When I select the pictures of several projects at a time and use the command "file > move...» ', the original images will be relocated in a folder for each project.  I use these presets:

    I tested with opening 3.6 on OS X 10.11.5.  What version of Aperture do you use?

  • Pierce the Parent and rest on top?

    Is this possible in FR the ability to register the Member parent base with the option to drill holes in the lower level members and have the parent to stay on top instead of move down after piercing?   If this isn't the case, en, is - it possible to do in SmartView?

    Thanks in advance.

    I don't think it's available in FR. In Smart View, you can create a smart slice and mention the zoom in as ancestor 'top '.

    The disadvantage is that you cannot change any settings that the slice is registered.

    Concerning

    Celvin

  • Why some colors do not appear. I used to go to tools-options-colors and rest set it evrytime I couldn't see something

    I tried to use the thing suggested in Options, but it displays more colors

    You can attach a screenshot to show what problems you have with the colors?

    • Use a type of compressed as PNG or JPG image to save the screenshot
    • Make sure you do not exceed the maximum size of 1 MB

    There is still a touch of color on the subject content tab: preferences #content if that's what you used before.

  • Outlook express screen will come but still white with the hourglass in the middle and rest as if frozen.

    my outlook express appears but I have a blank page with the hourglass stays in the center of the page above it outlook express State does not

    Hello
    Work through the steps in this article:
    An Outlook Express basic repair kit:
    http://www.Microsoft.com/Windows/IE/community/columns/oerepair.mspx

    Hope this helps,
    Don

  • How to set a header on the screen what scrolling doesnot and rest set up?

    I created a custom field for the title. When I add it to the screen, that there are no fixed to the upper part.

    If I add this field to setTitle(), it gets fixed but there is a white spot on the horizontal line under the header on the top field?

    How can I solve this problem?

    tried u setbanner?

  • JDev 11.1.1.9.0 REST and JCS

    Hello

    My goal is to generate an ADF application as well as some services of the ADF REST and to deploy it to an instance of the JCS.

    I have download initially, 11.1.1.7.1, which I know that he supports the deployment of JCS. However, I see no REST tab in the web service section of the application module. This means that I can't build REST services using this JDev version.

    I think that 12 version c of JDev do always not support JCS.

    If 11.1.1.9.0 supports both? Cannot find rest in the release docs.

    If not, then what is the solution for my needs.

    Please notify

    Thank you

    Vik

    http://adfjsf.blogspot.com

    JDev 12.2.1 does support JCS and REST. Then you should check this version.

    Timo

Maybe you are looking for

  • Looking for info on cable LCD of Tecra 8100

    Hello I have to buy a cable for my Toshiba Tecra 8100 LCD screen 13.3 "LCD size. I'm trying to find one on E - bay. Many people announce the cable for sale, but for 14 "Sceen. My question is: doesn't the cable LCD 13.3 "and 14" is unique and differen

  • service pack 3 does not load because of kbdhid.sys in use

    service pack 3 does not due to kbdhid.sys in use, I was updating after a repair windows, service pack 2 is installed, but the service pack 3 will not get spent about 1/2 in point because it says the kbdhid.sys open or currently in use, and there is n

  • Drive recovery by computer dealer

    When I buy a computer with a Windows operating system, the seller is obliged to give me a copy of the recovery disc if I want?  Thank you!

  • Desktop icons have all disappeared completely and cannot add new ones to the desktop display.

    I use Windows Vista Business Service Pack 1 on a Toshiba individual 5 months old Pro.Everything works well except all my desktop icons disappeared last week for example Recycle Bin, Internet Explorer, etc.I have activated since the "Desktop >" sectio

  • ATI Mobility Radeon HD 4330 on Inspiron 1545... .. Pilot?

    Both windows 7 x 64 driver for support of dell Inspiron 1545 and generic drivers on the site Web of AMDInstall the Manager of catalyst, but NOT to raise the ATI Radeon.I can not get this graphic material recognized and given a driver to enable in Dev