4 Replies Latest reply on Feb 9, 2013 3:22 AM by Mark Nongkhlaw

    How to display larger data returned from a web service in Rho Mobile ?

    Navnath Lanke

      Hi all,

      I am trying to call a dot net web service from Rho Mobile. I want to display the result in a table format on to the screen.

      I can call the web service and display the data but for less than 100 rows, I want to display about 1000 records on the screen. When web service returns such a big result, my Rho mobile application is getting crashed.

       

       

      Is anybody else has also faced this issue?

       

      Please help me, If someone knows how to resolve this issue.

       

      Thanks a lot in advance.

      Navnath Lanke

        • Re: How to display larger data returned from a web service in Rho Mobile ?
          Mark Nongkhlaw

          Can you provide more details? Like what type of webservice you're querying, does it return JSON? How are you retrieving and displaying the data? Are you testing on a device or simulator? I currently can list out 1939 records from my JSON webservice. I'm sure it can do more.

            • Re: How to display larger data returned from a web service in Rho Mobile ?
              Navnath Lanke

              Hi Mark,

              Thanks a lot for your reply.

              1) I am using a dot net web service that is returning a Data Set (XML).

                   The web service returns a table of 2 columns CustomerID and DisplayName.

              Number of rows depends on parameter passed "customertype"

              if the data table has about less rows, this works fine, but for larger row sets, the app creshes.

              2) The code snippet i am using is as :

               

              def call_soap_for_getcust(customertype)

                    http = Net::HTTP.new('localhost', 80)

                    path = '/WebSite/Service.asmx'

              # Create the SOAP Envelope

              data = <<-EOF

              <?xml version="1.0" encoding="UTF-8"?>

              <SOAP-ENV:Envelope

              xmlns:xsd="http://www.w3.org/2001/XMLSchema"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

              SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

              xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

              <SOAP-ENV:Body>

                <Get_Customer xmlns="http://tempuri.org/">

                        <CustomerType>#{customertype}</CustomerType>

                     </Get_Customer>

              </SOAP-ENV:Body>

              </SOAP-ENV:Envelope>

              EOF

                   

                    # # Set Headers

                    headers = {

                      'Content-Type' => 'text/xml',

                      'Host' => 'localhost'

                    }

                   

                    resp, data = http.post(path, data, headers)

               

              begin

                   

                    xmldoc = REXML::Document.new(data)

                   

                    names = []

               

              rowcount=0

                          @tablelist="<table border=""2"" BORDERCOLOR=Yellow>"

                        REXML::XPath.each( xmldoc, "//DisplayName") do |element|

                                    names << element.text

                            @tablelist+="<tr border=""2""><td border=""1"" style=""background-color:YellowGreen;color:white;"">"+names[rowcount]+"</td></tr>"    

                             

                            rowcount+=1

                          end

                        @tablelist+="</table>"

              end

              3) I am just testing it on simulator.

               

              hope this will give you the detail understanding of my issue.

               

              Thanks again for the help, that you can provide to me.

              • Re: How to display larger data returned from a web service in Rho Mobile ?
                Navnath Lanke

                Hi mark,

                Thank you for your participation and time in this discussion.

                Now I have got the solution.

                Basically, My result returned from the web service was giving some blank display names and it was turned to nil while putting to array. When i was trying them to display in a table, it was throwing exception.

                 

                I just handled for nil, and it worked out.

                 

                 

                Thanks a lot.