create the http client to retrieve data from web service

Hello

I am newbie on our webworks. I need to retrieve data from web service. How to connect to this service and analyzed. There is a tutorial that can help me get started with it.

Can any one advice me how can I start working with webworks on blackberry 10

Thanks for any help

In general, you will need to use an AJAX call to the server

It really depends on what the server returns as to how the information is easy to digest

JQuery provides a simple interface, and returns information easy to use

If you deal with things gets complicated XML according to namespace

If you look at the raw XML data and it goes something like fred: name you will have questions requiring an implementation of SAX - JSON is simple if you don't get that even if (nothing too confusing here)

If using an external data source JSON go if you have the choice

As examples go - just look to the top of JQuery Ajax [JSON / XML] and you will get where you're going quickly

SAX is MUCH harder because of the namespace - Dublin is the most common and same XML without namespace is not simple to handle, so avoid it if you can

Tags: BlackBerry Developers

Similar Questions

  • With the help of the socket object to retrieve data from web application without the html files

    I tried to use the socket object to retrieve data from a web application (I just control script version vs version online). So all I want to do is access http://hyle.io/version that returns me the current version of the application (such as a simple string) in order to compare it in my script and then notifies the user accordingly. I have just a few problems using the socket object. I used this code from the Adobe Javascript Tools Guide:


    reply = "";
    conn = new Socket;
    // access Adobe’s home page
    if (conn.open ("www.adobe.com:80")) {
    // send a HTTP GET request
    conn.write ("GET /index.html HTTP/1.0\n\n");
    // and read the server’s reply
    reply = conn.read(999999);
    conn.close();
    }
    

    ... that I then adapted as:

    reply = "";
    conn = new Socket;
    if (conn.open ("hyle.io:80")) {
      conn.write ("GET /version HTTP/1.0\n\n");
      reply = conn.read(999999); 
      conn.close();
    }
    

    And here is what I get:

    HTTP/1.1 400 Bad Request
    Content-Length: 225
    Content-Type: text/html
    Server: Pagodabox-Routing-Mesh
    
    

    Bad Request

    Your browser sent a request that this server could not understand.

    Résultat : true

    I don't know a lot about HTTP requests, but I wondered if it was related to the fact that I am not pointing to a specific HTML file and the type of request was wrong or if I should rather check if there is something wrong with my host?

    The site/app is PHP and is hosted on PagodaBox if it helps.

    Thanks in advance!

    Hi Sebastien Lavoie,

    It should work

    var HTTPFile = function (url, port) {}

    If (arguments.length == 1) {}

    URL = arguments [0];

    port = 80;

    };

    This.url = url;

    This.port = port;

    this.httpPrefix = this.url.match(/http:\/\//);

    This.Domain = this.httpPrefix is nothing? This.URL.Split("/") [0] + ":" + this.port: this .url .split ("/") [2] +":" + this.port;

    This.Call = ' GET ' + (this.httpPrefix == null? ' "). " http://" (+ this.url: this.url) + "HTTP/1.0\r\nHost: ' + (this.httpPrefix is nothing? "This.URL.Split("/ ") [0]: this .url .split (" / ") [2]) +" \r\nConnection: close\r\n\r\n ";

    This.Reply = new String();

    This.Conn = new Socket();

    This.Conn.Encoding = "binary";

    HTTPFile.prototype.getFile = {function (f)}

    var typeMatch = this.url.match(/(\.) (\w{3,4}\b)/g);

    If (this.conn.open (this.domain, "binary")) {}

    This.Conn.Write (this.) Call);

    This.Reply = this.conn.read (9999999999);

    This.Conn.Close ();

    } else {}

    This.Reply = "";

    }

    (Return this.reply.substr(this.reply.indexOf("\r\n\r\n")+4);

    };

    }

    Hyle var = new HTTPFile ("http://hyle.io/version");

    Alert (hyle. GetFile());

    And by the way, I like the idea of 'http://hyle.io'. Can you give me your email address, I want to learn more about this Web site.

    Please send me an email to [email protected]

  • Data from Web service to a Web service that keeps the Session control

    Following the example set by Rama cricket in [maintaining Session with JAX - WS | http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html]; I could create a WebService that keeps the sessions using JAX - WS.

    Now, I want to use this WebService, from control data in an ADF application, but unfortunately, I do not know how to tell from this data control that I want to maintain the session.

    I don't know if I should extend and overwrite the FactoryClass (oracle.adf.model.adapter.DataControlFactoryImpl) or if I have to do with the application definition (oracle.adfinternal.model.adapter.webservice.WSDefinition)

    I'm new to ADF and I understand that it can be simple, I just need an example or documentation to read.

    Thank you

    For the service, you can create a proxy of jax - ws and as mentioned in the document that you cited, activate the session on the client.
    This client class, you can then create a data bean control and use it in your ADF application.

    Vishal-

  • I used the migration assistant to transfer data from my pc windows for my macbook pro, and it erased all my data. Is he here to retrieve these data

    I used the migration assistant to transfer data from my laptop to windows xp for my macbook pro OS X Yosemite 10.10.5 version and she erased all the data on my mac iTunes i.e., photos, documents, games, etc. Is it possible to recover these data or take it back to a State of pre migration? If not can I erase it and reload the software from scratch?

    Thank you

    Dave has

    You have a backup of Mac before moving the data from the PC?

  • Scalar JSON parsing of the HTTP Client

    Hello everyone, I have been using the HTTP Client to call an API via HTTP GET to get a JSON string.  I want to be able to analyze all the information and data that I get in this JSON string.  I think that the JSON string I get is a JSON scalar and not an array or an object.  It looks like a combination of table and object.  Here is an example of the data that I'll be back:

    {"Measurements": [{"voltageRMS": 120.12,: 121044.295 ' currentRMS ': 11.85, ' totalEnergy '}], 'code': 'OK', 'time': 7}

    I tried to use "JSON unflatten" but it did not work.  I continued to get several errors.  Error 1 was that this path not found in JSON when I put in currentRMS as a string table in the way even though I am following the directions for help.  Error 2, is that I have a different type of data between JSON and LabView.  In one of the LabView examples, it is an array JSON goes to several unflatten JSON and it works fine (as long as it's a JSON array).  However, once I use my JSON scalar, the JSON unflatten function no longer works.

    So, I downloaded some addons and used the JSON API in the LAVA.  I used the JSON API for scalar but kept on getting errors.  One of these errors is that the vi is unable to analyze the data.  I tried with several vi analysis (i.e. timestamp).  I tried to use the JSON array and thus got errors.

    Any advice would be greatly appreciated, I'm completely stuck.  Help, please.  Thank you.

    Even if you have only 1 point in the array, the field of 'measures' is a JSON array - noted in square brackets. Don't forget - the cluster should match the JSON data structure you are trying to decode exactly (not the format you expect!).

    With JSON Unflatten - you can either convert the entire string JSON, or you can draw the elements individually on the way (for example, an XPath in XML).

    Here are some examples:

    In the top example - I unflatten the entire cluster and this will give an array of measures. In the second example, I only remove the "0th" of the measure as a scalar array. Had not added the '0' in the path of the table, the data type / output would have been an array of measures.

  • to retrieve data from xml data type

    Hello...
    I have a doubt in the oracle database... Here's how to retrieve data from xml data type?

    Like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
    3 4 toMonth5 5 ctTestPan1 6 costType2 7 toYear2012 8 fromMonth12 9 fromYear2011 10 11
    ') as xml from dual) 12 -- 13 -- end of sample XMLDATA, use below query on your own table etc. as required 14 -- 15 select x.* 16 from t 17 ,xmltable('/DETAILS/FIELDS_VALUES/FIELD' 18 passing t.xml 19 columns name varchar2(30) path './NAME' 20 ,val varchar2(10) path './VALUE' 21* ) x SQL> / NAME VAL ------------------------------ ---------- toMonth 5 ctTestPan 1 costType 2 toYear 2012 fromMonth 12 fromYear 2011 6 rows selected.
  • retrieve data from staging account

    Hello

    does anyone know how we can retrieve data from staging of account using 'Segmentation Wizard', "report analysis tool", model of fusion and mailing, etc.?

    Seems that these tools connect only to the production instance...

    Thanks, Sab

    SAB,

    for segmentation Wizard (and perhaps other office files), you will have to go file - properties - Custom and update the values for the name of pod, if you have a job you know what value it is as I am not "have a practice to watch.

    see you soon
    Alex

  • What is the best strategy to migrate data from Windows to one Mac to another? I use Parallels Desktop to run Windows on my current Mac but want to use Bootcamp on my new.

    What is the best strategy to migrate data from Windows to one Mac to another? I use Parallels Desktop to run Windows on my current Mac but want to use Bootcamp on my new.

    If it is only the data (not apps) I use Dropbox. It turned out to be the best way to move things between the side Mac and the bootcamped Windows of my iMac side. I don't see why it would not work to move data from a virtual machine installation of Win to a BootCamp installation.

  • Retrieve data from GenericType

    Hello

    I jdev 12.1.3, I use the following code in the java class to run the web service data and get the data, copy the following code return result to the parameter result GenericType object, I show the result in the form of attributes data and web service successful, now I need to get this information and but he parameter string, how do I do this?

            GenericType result = null;
            try
            {
                result = (GenericType) AdfmfJavaUtilities.invokeDataControlMethod("SOA_ProcessAfterLogin", null, "process", pnames, params, ptypes);
    
            }catch(AdfInvocationException ex) {
                   // If the web service is not available throw a nice exception
                    if(AdfInvocationException.CATEGORY_WEBSERVICE.compareTo(ex.getErrorCategory()) == 0) {
                       throw new RuntimeException("Error with the server.  Please try later.");
                    }
            } 
    

    The link you have given, pay attention to the

  • Where can I check the status of an interruption of a web service from Microsoft?

    Where can I check the status of an interruption of a web service from Microsoft?

    Current service status, please visit https://status.live.com. Please sign in with your Microsoft Account for more specific status related to your service.

  • Which service API should I use to retrieve data from Eloqua 'Integration of the internal queue'?

    In my Eloqua Sandbox environment, I managed to create several "external Test calls complete" that appear on the tab 'Reports of the integration of queue internally'. Can someone tell me what Eloqua API or services are required to recover the data of this "Internal queue" Eloqua? I guess that's the way to connect the dots of data updates occurring in Eloqua to an external system. My ultimate goal is personalized with a non-native CRM integration.

    Thank you

    Heath

    Hi Heath,

    The post following (How to recover data from activity through the API) describes how to extract data from the queue inside.

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • SQL to retrieve data from the day before

    Hello

    I am asked to collect intelligence data and generate a daily report to determine the success rate (to do daily data that determines success rate). I have a session_time of column (with the DATE data type) that I try to do the job. I've been using:

    Select * from ABC

    where session_time > = TRUNC (SYSDATE - 2)

    Gives me data, but I get the data from 26/10/14 and 10/28/14 so when I only need data on 27-10-14 (as of the day 28/10/14). I tried a few variations and did not get the expected result. Could someone please help me understand this? Time is also displayed in my outings, maybe I shouldn't include the time?

    I use: TOAD for Oracle 11.5.1.2.

    Oracle Database 11g Enterprose 11.2.0.1.0 Edition

    Thank you in advance.

    Hello

    2632048 wrote:

    Hello

    I am asked to collect intelligence data and generate a daily report to determine the success rate (to do daily data that determines success rate). I have a session_time of column (with the DATE data type) that I try to do the job. I've been using:

    Select * from ABC

    where session_time > = TRUNC (SYSDATE - 2)

    Gives me data, but I get the data from 26/10/14 and 10/28/14 so when I only need data on 27-10-14 (as of the day 28/10/14). I tried a few variations and did not get the expected result. Could someone please help me understand this? Time is also displayed in my outings, maybe I shouldn't include the time?

    I use: TOAD for Oracle 11.5.1.2.

    Oracle Database 11g Enterprose 11.2.0.1.0 Edition

    Thank you in advance.

    Use:

    SELECT *.

    ABC

    WHERE session_time > = TRUNC (SYSDATE) - 1

    AND session_time<  trunc="">

    ;

    It's 09:15 on October 28, 2014, then TRUNC (SYSDATE - 2) is 00:00:00 October 26; The query you posted became data of October 26 and later.  (You may not all future dates in your table.)

    If it's 09:15 October 28, then TRUNC (SYSDATE) is 00:00:00 October 28 (i.e., midnight, at the beginning of October 28) and TRUNC (SYSDATE) - 1 is 00:00:00 October 27.

    Do not be tempted to use

    WHEN TRUNC (session_time) = TRUNC (SYSDATE) - 1 * INEFFECTIVE!  ***

    It will get the same results, but it is slower, you cannot use an index on session_time and requires a call to separate function for each row in the table, it is selected or not.

  • How to retrieve data from the database after the removal of the lines of the VO?

    Hello
    I use Jdeveloper 11.1.2.1.0
    I have a master's degree and a child.

    So according to my use case when a value in the master t changes the corresponding child should be removed.

    but when I change it to any other value I want to cancel the delete operation and retrieve values in children.

    Is it possible to do?


    Kind regards
    Nigel.

    Edited by: Nigel Thomas March 29, 2012 05:07

    Edited by: Nigel Thomas March 29, 2012 05:09

    Check [url http://mjabr.wordpress.com/2011/05/20/perform-deleteundo-delete-without-using-rollback/] recover deleted lines without using rollback

  • Retrieve data from AddressBook for Webworks Smartphone

    Hi all
    I want to implement the address book API. Where can I get/retrieve data (phone number, address of E-mail etc) for my Application project.
    Is it possible to invoke the address book to recover data?

    I go through this link, but it did not help me https://developer.blackberry.com/html5/apis/blackberry.invoke.addressbookarguments.html#view

    I have searched several times but could not get a code to make it possible.
    Please help me if someone know the solution or have any sample code.

    Thank you best regards &,.
    Castillo

    Its seems quite surprising that no member of this forum suggests even a single code related to this problem...

    However, I still have more research and find the alternative.

    var contactResult = new Array();
    
    var Fname = new blackberry.find.FilterExpression("firstName", "!=", "");
    
        contactResult = blackberry.pim.Contact.find(Fname);
        for ( var i = 0; i < contactResult.length; i++) {
            var totalName = contactResult[i].title+ " "+ contactResult[i].firstName+ " "+ contactResult[i].lastName;
            }
    

    This will retrieve all data or contacts from the address book. For which I have to do a custom address book.

  • Suggestions to overcome this problem: a bug with the HTTP PATCH request with data on the body

    Hello guys,.

    I'm really stuck with a problem and I'm looking for suggestions for solutions and help implementingit.

    In summary:

    (1) the third REST API that I use use HTTP PATCH with the JSON data.

    2) there is a bug in Qt 4.8 that prevents me from using the http verb.

    (3) one of the main features of my new app is severely compromised because of this.

    (4) I found an independent patch to the bug in question.

    What are my options now?

    (A) should I patch Qt reconpile and 1980s, me with my application? I have no experience with these procedures.

    (B) is it possible that I can only implement the elements of fastening of the patch in my application code? I don't see how.

    (C) request and wait for BlackBerry for the patch and release it on the next update? That imensily would limit my clients, only running 10.3.3 and I was 10.3.0.

    (D) any other alternative!

    As I said, I'm really stuck now. I was able to realease my app without this big news, but it would be a great disappointment.

    Any help is appreciated.

    Thanks in advance.

    Here's the code in a Stackoverflow thread on the same topic, I can't try it myself, but let us know if it works and mark @oniongarlic response as a solution if it works.

    Thread: http://stackoverflow.com/questions/34065735/qnetworkaccessmanager-how-to-send-patch-request

    Code:
    QString destination ="";
    currentNode.replace(QString("/").append(latestNode),""); "
    destination
    . Append (Host)
    . Append (CurrentNode)
    . Append(".) JSON");
    QString jsonString=QString(QString("{").append("\"").append(latestNode).append("\"").append(":").append("\"").append(str).append("\"").append(QString("}")));)
    QNetworkRequest request (destination);
    request.setHeader (QNetworkRequest::ContentTypeHeader,
    "application/x-www-formulaires-urlencoded");
    qDebug()<>
    QBuffer * buffer = new QBuffer();
    buffer-> open ((QBuffer::ReadWrite));))
    buffer-> write (jsonString.toUtf8 ());
    buffer-> seek (0);
    Manager-> sendCustomRequest (request, "PATCH", buffer);
    qDebug()<>

Maybe you are looking for