06-12-2012 04:18 AM
Very interesting scenario, and a challenge.
I have developed an application which consumes web services. Web service response is a small amount of data (Not bulk data). I tested web service on good network (wifi and mobile internet [BIS]).
Application is working perfect, all the web service calls and response is perfect. But my application is also being used in areas where internet is slow (application is being used in different countries). In that case some times there is no response from the web service.
On some pages i show list of data that is fected from web service. (again i say, data is not huge)
Web service has response before the timeout, but still there is no data. (I am sure there is no filter on data)
In those areas, most of the time data is populated, but sometimes page is empty because there is no data in response.
User can browse web pages by using browser using the same internet connection. But faces problem in my application.
I know the problem is bad internet. I think somewhere in the transport layer, some packets of data are lost. and thats why in response there is no data. I am using HttpTransport. and web service .asmx.
What i expect from you all is, please suggest me some different protocol that ensures the arrivale of respose from web service. Or tell me if changing web service to WCF web service can effect the response.
I need some way to make sure that, i get a response properly when i make a request to web service. There can be a delay in response, but there must be a response with data. Internet should not borken.
06-13-2012 02:19 AM
The problem looks to me is, lost of data packets due to bad/slow internet connection.
Most of the time i get the data from web service successfully, but sometime not.
Can you please suggest me possible work around to fix this problem.
I don't want the user to see "Error in connection" message (i show this on connection error), because browser works fine.
06-13-2012 09:53 AM
"In that case some times there is no response from the web service".
There will always be a response, or an Exception on the connection which might indicate a variety of problems, from timeout to no connection. Reviewing your question suggests that your code does not handle the exceptions very well, perhaps you are treating any exception as 'non response', which is not really correct.
"User can browse web pages by using browser using the same internet connection."
Is it using the same connection? How do you decide which connection method you are going to use? There are a number, as you can see in the network video:
Have you deliberately chosen which of these you are gonig to use?
"I think somewhere in the transport layer, some packets of data are lost"
Never seen this myself. As noted, it is much more likely that your application does not cope very well when the network is slow or there is a failure.
"please suggest me some different protocol that ensures the arrivale of respose"
HTTP runs on top of TCP/IP, which is a guaranteed delivery protocol (assuming here is a connection available). So I would review your code. Are you single threading your requests? Are you coping wth all the exceptions?
06-15-2012 02:25 AM
Thanks peter for your reply.
Yeah i know there are different ways to connect to internet on blackberry, and i use the one avaialble. Like i do check for wifi, provider network etc... Its not a problem.
User can browse different sites using the same network that application uses. but some time the connection is broken in the application.
Yes, i am handling exceptions. Yes i know there would always be a response from web service seccess/failure. What i mean is that some times i get connecting exception. Like i requested from web service for some data (small amount of data), most of the time it is loaded, but sometime using same intenet the data is not loaded and exception is raised. Its like IOException.
I know that TCP/IP is a guaranteed protocol, But the only problem is due to bad internet, when during transfer of data some bits are missed, application throws exception and i do catch.
My question is how to handle this? One option is put a retry mechanism in the application when connection exception is raised. Do you have any other suggestion? I need some fix, because user says if this scenario is handled in browser then your application should also have that capability too
06-16-2012 04:04 AM
"User can browse different sites using the same network that application uses. but some time the connection is broken in the application"
So you are 100% sure your application is using the same connection method as the Browser, and perhaps dynmically swapping between connection types when one fails and or a Listener indicates there is a network service outage? I would suggest that there is some seriously clever code in the Browser to handle this sort of thing. Is there this sort of detection, recovery, retry logic in your code?
"One option is put a retry mechanism in the application when connection exception is raised. Do you have any other suggestion?"
That is pretty much what I think the Browser does. No other suggestions sorry.
Do you use BIS-B?
06-18-2012 12:56 AM
Thank you for reply.
-Yes i am sure that my application is using the same network as browser.
I have put quite intelligent code to recognize and connect to available network.
-And yes the code also handles BIS-B. User are using BIS-B when not using wifi.
The only option i have is to put a retry mechanism. I just changed the application. Let see the response from the users now.