Retrieven data from a Web server...

Hello, I need get data from a Web site, I'm developing it with XMLHttpRequest.

I have this code (copy of an example in the area of the developer) and if I connect via browser work perfectly but if I compile my .cod and run Simulator not working.

I have 3 options in my code, 2 are local file and 1 is for file server, a file local do not problem, but with the file of the server do not work.

Any can help me? Best regards!

My code is:

XMLHttpRequest example
   


   


       
onClick = "updateContent ("http://www.mysite.com/version.asp ")" / > HTML ""

       
onClick = "updateContent ('data.xml')" / > XML

       
onClick = "updateContent ('data.txt')" / > text

       
onClick = "updateContent ('unknown_file.txt')" / > no that there is no file
   


   

Finally, I have the solution:

I paste the code if it is useful for someone:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.DTD">


    XMLHttpRequest example
   
   


   


       
onClick = "updateContent ("http://www.mysyte.com/dat/data.xml ")" / > HTML ""

       
onClick = "updateContent ('data.xml')" / > XML

       
onClick = "updateContent ('data.txt')" / > text

       
onClick = "updateContent ('unknown_file.txt')" / > no that there is no file
   


   


Tags: BlackBerry Developers

Similar Questions

  • Copying files from a web server to the VMFS data store

    Hi everyone I have a little trouble working it.

    I say a file on a Web server http://webserver/important.txt and I want to copy this file in a local data store.  I am able to copy the file from the Web server to the server I'm running PowerCLI, and then to the data store, but I can't work on how to copy directly.

    Any ideas?

    As far as I know, the Copy-DatastoreItem cannot handle this. The cmdlet requires a path to the Item parameter.

    You will need to first create a local file and then copy in the data store.

  • getting data from a web site

    I have a device that has a built in web server that I need to write a program of LV

    I need to read the date, that the web server is producing and compare it to the data measured actcual.

    Now, the measurement and the comparison is easy but I do not know how LV reading a Web page.

    Any ideas or examples?

    Hello

    See http://zone.ni.com/devzone/cda/epd/p/id/2743. It has the code to get the HTML from a URL. Once you have that, all you have to do is to analyze this code (String) for the data of interest.

    Amit Mathilde

  • Exception during consumption of huge data from a web service.

    Hello

    I m developing an application to receive data from a Web Service and retain the data received on the device.

    App is developed for OS 4.3.0

    The Web Service call is made using Ksoap. The Code receives the data from the web service, analyzes the data and stores it in an object. This object is then persisted on the device. The data are essentially the coordinates. It takes the number of contacts required as input and passes it to the Web Service. The Web Service then returns the requested number of records

    The code works if I ask data of up to ~ 600 cases. If I specify more than 600 cases, it throws the following exception

    Chain rg.xmlpull.v1.XmlPullParserException:unexpected type (position: TEXT entity request in T...@1:24 in java.io.InputStreamReader@1f87d1b4)

    When I debugged using Eclipse, this exception is thrown on this statement ht.call (soapAction, envelope);

    Would it be because of a time-out? OT is because the Analyzer is not able to analyze huge data?

    Given that this exception occurs on the declaration of ht.call, I guess the problem is with the web service call and not with the code for persistent storage.

    I have included the code here... Is could someone please show me what the problem is?

    C ode to call Web Services

    public Vector getWebData(String count)
        {
    
       Vector personsVectorto = new Vector();
        try
        {
        StringBuffer receivedContent = new StringBuffer();
        String serviceUrl = "........";
        String serviceNamespace = ".....";
        String soapAction = ".........";
    
       SoapObject rpc = new SoapObject(serviceNamespace, "GetContactsList");
            //rpc.addProperty("listSize", "5");
            rpc.addProperty("listSize", count);
         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    
            envelope.bodyOut = rpc;
    
            envelope.dotNet = true;
            envelope.encodingStyle = SoapSerializationEnvelope.XSD;
            HttpTransport ht = new HttpTransport(serviceUrl);
            ht.debug = true;
    
            ht.call(soapAction, envelope); // This is where thexmlpullparser exception occurs
    
     Object obj = envelope.getResponse();
            SoapObject soapResult = (SoapObject)obj;
    
                for(int i=0; i < soapResult.getPropertyCount(); i++)
    
                {
                  PersonDTO personto = new PersonDTO();
               SoapObject choice = (SoapObject)soapResult.getProperty(i);
                if( choice!=null)
                {
                    for(int j = 0; j < choice.getPropertyCount(); j++)
                    {
                      receivedContent.append(" Reading Property Number" + String.valueOf(j) + " Value = " + choice.getProperty(j).toString());
    
         if (j==0) personto.setElement(1,choice.getProperty(j).toString());
        if (j==1) personto.setElement(2,choice.getProperty(j).toString());
        if (j==2) personto.setElement(3,choice.getProperty(j).toString());
        if (j==3) personto.setElement(4,choice.getProperty(j).toString());
        if (j==4) personto.setElement(5,choice.getProperty(j).toString());
         if (j==5) personto.setElement(6,choice.getProperty(j).toString());
         if (j==6) personto.setElement(7,choice.getProperty(j).toString());
          if (j==7) personto.setElement(8,choice.getProperty(j).toString());
         if (j==8) personto.setElement(9,choice.getProperty(j).toString());
       if (j==9) personto.setElement(10,choice.getProperty(j).toString());
                    }
                }                 
    
                personsVectorto.addElement(personto);
                //storepersistentobject(personsVectorto);
            }
    
            }catch(org.xmlpull.v1.XmlPullParserException ex2)
            {
                String bah1 = ex2.toString();
                Dialog.alert("String: " + bah1);
                String bah2 = ex2.getMessage();
                Dialog.alert("Message: " + bah2); 
    
            }       
    
            catch(Exception ex){
                String bah = ex.toString();
                Dialog.alert("Response: " + bah);
    
                }
    
                return personsVectorto;
        }
    

    Thank you

    Hi Philippe,.

    First Question: Print server response

    Yes - I think for you too in fact just print the answer you'll have to do a regular HTTP call to the server and print it like this:

    StringBuffer sb = new StringBuffer();

    int thumb;

    HttpConnection httpConn = (HttpConnection) Connector.open (url);

    httpConn.setRequestMethod (HttpConnection.GET); or by POST depending on your needs

    in = httpConn.openInputStream ();

    While ((thumb = in.read ())! = - 1).

    {

    SB. Append ((Char) inCh);

    }

    System.out.println ("server response:" + sb.toString ());

    Try and see if you get a request too large entity. Note: you should probably put your SOAP request in GET or POST http request.

    Second Question: Is zipping required?

    This is how I chose to do for my particular needs that transfer me a large amount of data and the compression algorithm seems to keep all my data well below 40 k. However, it is not the only way, you could actually make several requests and get data piece by piece, but I don't know if it works well with SOAP responses. Depending on the type of Network Setup Blackberry you have, you can also set this limit to be higher (I think a maximum of 1 024 Ko for BES).

    Third Question: Timeout Logging

    For wait times, usually the exception you get should indicate that there was a timeout, but if you are suspicious that it's a timeout check your web service and see.

    Hope that helps!

    R

  • If I remove all the data from the Web site it will also remove all my passwords?

    If I remove all the data from the Web site it will also remove all my passwords?

    It will not erase your saved in the Keychain passwords, but you need to connect back to all Web sites (like this one) that require you to log in.

  • PHP form script is missing from the web server or PHP is not properly configured on your web hosting provider. Help - I get this message on my site when the form is filled out and you press send... Check if the form PHP script has been downloaded correctl

    PHP form script is missing from the web server or PHP is not properly configured on your web hosting provider. Help - I get this message on my site when the form is filled out and you press send... Check if the form PHP script has been downloaded correctly, contact your host about the configuration of PHP.

    Hi Graham,

    If you, please add your site to this link ( http://my-site.com/scripts/form_check.php ) and make sure that all green checkmarks are appearing. If they don't, let us know what errors you seem to receive and include the link to your site.

    In addition, check out this guide on the forums of Muse troubleshooting: Troubleshooting Muse form used on the servers of third party Widgets

    I hope this helps!

    Emily

  • How to fill a ComboBox with data from a Web service

    I have a simple application that contains a DataGrid control that gets its data from a web service. I prefer to put these data in a ComboBox instead of a DataGrid control. My web service returns objects.

    Someone has an idea how to do?

    < mx:DataGrid id = dataProvider = "{ws.getProjects.lastResult"dgProjects"}" > "
    ... < mx:columns >
    ... < mx:DataGridColumn dataField = "projectID" headerText = "ID of project" width = "100" / >
    ... < mx:DataGridColumn headerText = "Project name" dataField = "projectName" / >
    ... < mx:DataGridColumn headerText = "Doc UNID" dataField = "docUNID" visible = "false" / >
    ... < / mx:columns >
    < / mx:DataGrid >

    Exactly what I needed.

    Thank you very much!!!

  • Remove data from the HD Server?

    I've recently updated my OS to 10.12 Sierra and went to install Server.app. However, when trying to install Mac OS Server, I received the following message:

    "This the server version does not support upgrading the server from data on this volume. To upgrade your database server, you need to install an older version of the server and OS X."

    ***? In what universe would be an acceptable solution? Now, the fact is that I probably had installed Server.app before on a very old version of Mac OS (not sure which) and just never bothered to upgrade during the last major revision of OS X or more.

    What that is, how can I get rid of these old "data server" so I can install a new copy? Thank you.

    Wondering how to remove the data from the server that you had before the upgrade to Sierra? If so, delete the folder/Library/Server and the.app to / applications. Then go to the App Store and buy the latest version of the server. I'm guessing that your last purchase server had Yosemite and that's why try to install the server to the App Store / Shopping does not work. I did purchase the server from Yosemite.

  • Display data from another web application

    Hello

    I hope than to display data from my application 'team' on my 'articles' approx. basically display image of the author, email etc., which comes from the app TEAM. I know that this is possible.  I use the data of the src field extract the name of the authors, but of course this provides only a link. Are there tutorials - what can anyone tell me? Thank you.

    So does that mean as a concrete response by using the system of normal with BC, is tag that you insert this code for your team web app {module_webapps, 123456, i, {tag_author_id}} on your layout displayed products app page.  ID tag of the author is a field set up in the articles web app and a field of the data source to connect to your team application.

  • Filter or manipulate data from e-mail server before coming to the mail program

    How can I manipulate the data of the mail server until it gets pulled a software such as outlook e-mail.
    For example, I want to write data of e-mail on db before it gets pulled into the e-mail program.

    Is there a way to define the filter as the structures that work between the email server and the DB?

    Of course, you can write the code with cfpop get the header etc, but what happens if I want to record all e-mail data on the database, how can I do that to save a copy of the email that is pulled in the e-mail program, if I understand well once the message is off the server so I would not be able to synchronize the db with the new messages with a kind structure of the scheduled task.

    Or is it really something that you can configure completely by the parameters of the mail server itself? Here again, in shared or vps of installation, you probably haven't a lot of settings to set as you may not beside Server.

    Any ideas will be appreciated.

    Thank you.

    (a) use a DEDICATED e-mail account, which is NOT checked (= email
    Downloaded) from any e-mail application
    (b) use CFPOP to retrieve electronic messages, analyze needs, store data
    DB and delete the message
    (c) use intrusion via CFMAIL to send a copy of the message to another email address that
    Download messages for archiving (if necessary at all - you are
    already to store mails in the comics...)
    (d) [optionally] based on use of the e-mail headers, subject, body, etc intrusion via CFMAIL (or
    a gateway SMS or IM) to inform staff on new
    request/ticket/whatever

    just some thoughts...

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • C410a won't for mac with os x 10.8 but is accessible from the web server or old OSX

    The c410a ceased to behave with the Mountain Lion.  The new OS machines can access via the built-in web server, but not other way.  Old mac running Lion has no problem

    As I've recently updated Norton on the newer machines, I suspect that maybe that's a problem.

    What router?

    Why you use Norton?  There is no such thing as a Mac virus and until there is...

  • PL/dynamic sql to retrieve the data from the production server

    Hello

    I need to create a dynamic pl/sql program to retrieve all packages from the production server and store it on my local machine in another file.

    Thanks in advance.

    Hello

    user9963922 wrote:
    Hi Peter,.

    Thanks for the reply.
    I need make my block dynamic while in a single query, for different packages I can save it in another file with the same name as the package on my local machine.

    What is the problem with the suggestion of Peter? This is not 'dynamic' on this subject?
    To save the code in the files, use utl_file. Inside the loop, open, write, and close a file. If you need help, your zip code and a description of the specific problem.

    It is also possible to use only user_source table to accomplish the task.

    Yes, but it doesn't work for you own schema.
    If you do not use user_source, then you will not need any condition as

    and owner in ('')
    
  • Data from the file server error

    Hi, I used the following steps to create a server for FILE data

    To create a server for file data:
    1. connect to the topology Manager
    2. Select the topology > physical Architecture > Technologies > file in the tree of
    3 right-click and select Insert data server
    4 fill in the following fields in the Definition tab:
    • Name: the name of the database server will appear in Oracle Data Integrator
    • Username/password: not used.
    5. complete the following fields in the JDBC tab, depending on the driver used:
    • JDBC Driver: com.sunopsis.jdbc.driver.file.FileDriver
    • URL JDBC: jdbc:snps:dbfile
    6. click on Test
    7. click on Test in the Test connection window

    But I get an error

    http://img30.imageshack.us/img30/5173/test3i.jpg

    Can you please tell me what I'm missing. I'm new to ODI

    Hello

    Its just typo error, you mentioned here properly properly as com.sunopsis.jdbc.driver.file.FileDriver jdbc driver

    but looking carefully at the image file, you send, you talked the driver files, wrongly, that you are missing the word 'pilot' in your jdbc driver.

    Correct it and it will work.

  • VIX file in the user interface designer receives the data from the Web service application that communicates with the SQL server database

    I created the Web service VI ("Mt-insolacije.vi"), which has two terminals of the input string (FROM / TO) for the dates of arrival and exit of two data terminals (table 1 d) from database (MS SQL server). This VI communicates with the database with functions of the database with a DSN and SQL query appropriate palette. There are two tables with two data (time and Insolation) columns in the database.

    This VI works when you run in Labview 2010, but when I used it as VI in UI Builder it returns no data.

    Could you please help me find a solution. Is it possible to communicate with the SQL server database in this way or there is another way?

    There are two files attachmet: Image of .vix file in Interface builder and .vi file ("Mt-insolacije.vi")

    Please help me ASAP!

    Thank you

    Ivan

    I found the solution problem is in the DSN. I've been using the user instead of DSN system DSN.

    It's important to create the system DSN if you want your VI of web service to communicate with the database.

    PS Please put feature bundle format timestamp and XY graph in the web user interface designer. It's complicated to trace data with datetime on X axis without them.

  • Does anyone know how to get data from a web service of Labview with ajax or JSON?

    Hello

    I try to use ajax and json to service Web restful which I build with the labview. However I get errors

    For example. I create a web service from a labview vi (z = x / y http://localhost: 8080/math/divide/5/20 will give {Z: "4,000,000"})

    I get errors for the attached html files.

    Does anyone know how to get al labview WebService with ajax or json data?

    Thank you... Eran


Maybe you are looking for