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

Tags: BlackBerry Developers

Similar Questions

  • 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!!!

  • 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


  • Extract the data from the web service response

    Hello

    I called a web service and in response to XML data, now I have to extract the values and store them in the array

    My steps,

    1 call WebService
    2 answer stored in the CLOB column
    3, then used after the request

    SELECT loc.*
    OF my_xml PO,.
    XMLTable (XMLNAMESPACES)
    "urn: schemas-microsoft-com: XML-diffgram-v1" as "diffgr".
    ,'http://api. .com / "as"ns0"
    )
    ,'/ ns0:DataSet / diffgr:diffgram/NewDataSet/OptOutAll '
    PASS xmltype.createxml (PO.xml_data)
    COLUMNS
    "E-mail" TANK (100) path "Email."
    'Reason' TANK (150) PATH 'reason '.
    ) As loc
    WHERE ROWNUM < = 10;

    I wrote using this example

    But it does not work, do not know why

    / Zab

    If I use the XML (stored in the table XMLType TMP_XML) below:

    
    
      
        
          
            
              
                
                  
                    
                      
                        
                          
                          
                          
                          
                          
                        
                      
                    
                  
                
              
            
            
              
                
                  2012-05-09T22:40:00+02:00
                  information
                  111111
                  Subscriber confirmed
                
                
                  2012-06-07T22:30:00+02:00
                  information
                  111111
                  Subscriber confirmed
                
                
                  2012-06-14T00:20:00+02:00
                  information
                  111111
                  Subscriber confirmed
                
                
                  2012-06-19T20:50:00+02:00
                  information
                  111111
                  Subscriber confirmed
                
              
            
          
        
      
    
    

    Then I can do:

    SQL> SELECT x.*
      2  FROM tmp_xml t
      3     , XMLTable(
      4         XMLNamespaces(
      5           'http://www.w3.org/2003/05/soap-envelope' as "soap"
      6         , 'urn:schemas-microsoft-com:xml-diffgram-v1' as "diffgr"
      7         , 'http://api.***.com/' as "ns0"
      8         )
      9       , '/soap:Envelope/soap:Body/ns0:GetOptOutAllResponse/ns0:GetOptOutAllResult/diffgr:diffgram/NewDataSet/OptOutAll'
     10         PASSING t.object_value
     11         COLUMNS OptOutTime  TIMESTAMP WITH TIME ZONE PATH 'OptOutTime'
     12               , MailingList VARCHAR2(100)            PATH 'MailingList'
     13               , Reason      VARCHAR2(150)            PATH 'Reason'
     14       ) x
     15  ;
    
    OPTOUTTIME                          MAILINGLIST                    REASON
    ----------------------------------- ------------------------------ --------------------------------------------------------------------------------
    09/05/12 22:40:00,000000 +02:00     information                    Subscriber confirmed
    07/06/12 22:30:00,000000 +02:00     information                    Subscriber confirmed
    14/06/12 00:20:00,000000 +02:00     information                    Subscriber confirmed
    19/06/12 20:50:00,000000 +02:00     information                    Subscriber confirmed
     
    

    Are you getting something different?

  • Reading the data from a Web service

    Hi all

    I have a webservice that returns the square of the number.


    < s0:ZJK_FLEX_TEST.Response xmlns:s0 = 
    "urn:sap-com:document:sap:rfc:functions" 
    xmlns:SOAP - ENC = 
    "http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      
    <DATA1>0000016</DATA1>
    </s0:ZJK_FLEX_TEST.Response>
    
    

    the data1 contains the value.


    but I am not able to set this value in the text field in the flex.

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    public void result_getAll(event:ResultEvent):void

    {

    Alert.Show (Event.Result.ToString ());

    Here, I would like to put the value in the text field.

    }

    What do you see with this:

    Alert.Show (Event.Result.ToString ());

    What happens if you do the following:

    Alert.Show (Event.Result.Data1.ToString ());

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Support services and training, tutoring, Contracting, Flex

  • 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.

  • 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
       


       


  • ADF Mobile Page with the data control of Web Service not showing latest results

    Hello

    I developed a simple mobile application of ADF. It has two functions members and subscriptions. These two pages are part of my Taskflow. On the members page I show all members in a list by using the Web Service method data Find command. In the list item have a listener property Set where I'm storing MemberId in a variable of pageFlowScope for action. On the subscription page, I have a bar graph that gets the data with the help of a Find method in control of data to the Web Service. The find method is based on a view created criteria which has a member ID of input parameter. in the model of ADFBC project. I connected the variable using the AMX page binding. The variable is being levied on the pageFlowScope variable.

    The page displays the chart first to a member. And shows the same graph for the other members. I printed the memberId variable and it shows the value of the respective members. But the cards are not get updated every time I select new Member.

    I use JDeveloper 11.1.2.4.0.

    Any suggestions?

    Thank you

    Mehabub

    Go to the Connections tab, and then click the Green plus sign on the central section - you need to add a 'invokeAction. Give it a name, and then select the iterator that built the table, and that's all you should have to do. The invokeAction fires whenever you visit the page and should update the list.

    Rich,

  • Windows 7 hangs during the transfer of data from one drive to another

    This problem was pestering me for a long time, well over a year.

    When I transfer data from one disk to the other (generally large amounts), the computer crashes and I get a blue screen or it just restarts.

    Initially, I thought it was a faulty hard drive, so I replaced that, but the problem persisted. I ran diagnostics of smart drive on all my drives and no problems have been picked up.

    Then I replaced my RAM assuming there that all. The problem continues.

    Then I replaced the video card. The same problem.

    I then upgraded to windows 10 and the problem became more acute, so I rolled back to windows 7.

    The SSD has the latest firmware, the latest graphics card drivers.

    I think now it is one of the following two issues:

    Either my SSD drive that contains the operating system or motherboard?

    Someone at - it ideas of how to diagnose precisely this problem or how to solve it? Would contribute to a new facility?

    PC: Windows 7 SP1, AMD Phenom II X 4 965, Kingston 16 GB 1866 MHz DDR3 Non - ECC CL9 DIMM (Kit of 4) XMP beast series - HX318C9T3K4/16, AMD Radeon (TM) R9 series 200, Asus M4A87TD/USB3 motherboard

    Pilot, verified and associated usbfilter.sys from Advanced Micro Devices Inc. USB filter driver.

    Remove the driver current completely and install the latest driver available.  For instructions on how to do read everything to update the drivers of my partner JMH3143 http://answers.microsoft.com/en-us/windows/wiki/windows_other-hardware/updating-a-driver/a5e6345e-af9b-4099-bef0-8d22254aa1c1?tm=1436753520149 here

    Also and important you need to update this driver since 2005.  It is a known problem in win 7 (ASACPI.sys)

    Pre 2009 this driver version is a known cause of BSOD.

    Please visit Asus tek computer Inc. - support - drivers and download p7p55d the
    http://support.ASUS.com/download.aspx?SLanguage=en&m=P7P55D%20Le&p=1&s=32&OS=29&hashedid=e7zic83pvqsr80lm

    Scroll to the utility category, then scroll down to the "atk0110 driver for Windows XP/vista/windows 7 32 & 64-bit" (it is about 12 down).
    Download and install it.

    Go to c:\windows\system32\drivers to check and make sure that the file asacpi.sys is stamped 2009 or 2010 (not before).  If you are using Win 8 there are at least a 2012 version that is needed for this.  If you can't find it on the site of ASUS you can download using windows update.  Read about it here
  • 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

  • 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.

  • How to clear the inputText field that contains control data to the Web Service data?

    Hello

    I use JDeveloper 12.1.3 and 2.2 of the MAF.

    I created a Web Service data control that offers the feature of the View object on the server side.

    To use this, I created a taskflow with two pages of amx. The first page of the amx contains a button to call the other.

    The second page of the amx contains fields inputText with the values of the parameters of creation out of the data control functions.

    If I call the second page of the amx inputText fields are empty. On the page, I have a button to call the function of creation itself. By pressing the key the inputText field values will be sent to the server. Everything works great! Pressing on the button also calls for action to return to the first page of amx in the taskflow.

    Now, if a next time I call the second page the inputText fields contain the values from the last call.

    I want the inputText empty fields each time. How can I achieve this?

    Thanks in advance.

    Martin

    You can ask this question in the forum of the MAF

    Oracle Mobile Application Framework

  • Data for the Web service control

    Hello

    I have jdeveloepr User 12.1.3, I WSDL soap, I create the data control for the web service from the WSDL, the problem is when creating data controls the separate parameter that the method, for example, below it is the method that I call the setNotificationAction name and the parameter IN (P_ACTION, P_NOT_ID, P_PASSWORD_ERP, P_TOKEN (, P_USER_ID P_USER_ID_ERP), as below, why the separate parameter that the method?

    Note that I try the binding WSDL SOAP UI and its ok and works as expected.

    1.png

    Resolved by changing the typesList.add (Object.class) at typesList.add (GenericType.class)

  • Problems to change my url endpoint data control for Web Service design time vs deploy times. Where is the url of time to deploy the "deployment configuration" stored?

    https://blogs.Oracle.com/ADF/entry/changing_endpoint_url_for_a_web_service_data_control

    Using this link as a reference, I created a data control Web Service, and when I deploy via JDeveloper for different environments I can change my point of endpoint accordingly on this screen:

    Capture.PNG

    However when I change my point of termination at the design time, the changes do not appear in the screen "Configuration of the deployment. This would not normally be a problem, but our automated deployment (maven/ant) seems to keep picking up the url "Deployment Configuration" instead of what we change in the DataControl.dcx. So I have a few questions:

    1. Why is there a difference between what we have in the source code and what is shown on this ""Deployment Configuration "screen for manual deployment of JDeveloper? "

    2. where is this "Deployment Configuration" end point url located? I can change it during an automated deployment as I can on a manual deployment?

    3. What is the best practice to change a url endpoint to the Web Service data control with during an automated deployment?

    It turns out that the connections.xml had the url of the endpoint that the profile of the deployment and jdeveloper was referencing at deployment time.

    In order to get our automated generation work, we use a search and replace of Ant utility to change endpoint in this connections.xml before construction/deployment of the application.

Maybe you are looking for

  • Printer Envy 7460: How Hackable is my Envy 7460 printer?

    The recent attacks denial of Service distributed on the main websites used a large number of pirate designs accessible Internet, including printers.  How hackable is my Envy 7460 printer?  Can I change the password? Thank you.

  • Re: Satellite L630 - 107 (PSK04E) - some Win 8 drivers are missing

    I use Toshiba Satellite L630 - 107 (PSK04E).Recently I installed windows 8. Some drivers as a value-added package are not proceed with the installation... so I can't turn off my wireless...Can someone help me get rid of this problem?

  • Satellite L670 19th low level background noise

    Hello Recently purchsed a L670, it lowered Windows 7 for Xp and now find that there is a very low noise level issued with headphones which seems to be associated with the background of hard drive operation, can someone suggest how I can fix this prob

  • Possibilities of upgrade for my HP Pavilion 15-b142dx

    Thus, according to the specifications of my laptop, I can update my APU of A6 - 4455 accelerated m AMD processor clocked at 2.6 Ghz. But when I try to look for the part, its nowhere to be found. Even AMD does not provide them. IM distraught. I wonder

  • What the #* & % and where can I find WINRAR

    [san andreas pilot] concert 7.6 downloaded fine tried opening all the ways I don't know WINRAR TO OPEN WHERE can I FIND IT IN MY COMP or ONLINE