Rana Dey

+ Follow
since Jul 05, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rana Dey

We have a webpage (let's say webpage 1) having multiple divs, which displays based on user operations.

On browser back operation, the page webpage1 is being redirected to another page webpage2. For this we are getting page onunload event.

This page receives this onunload operation multiple times i.e. for all the divs which were loaded previously. That is, if on webpage1, div1, div2, div3, div4 being accessed by user previously. and if he presses back button when div4 was open on webpage1 then we observe div4 --> (back operation)--> div3 --> (back operation)-->div2 --> (back operation)-->div1--> (back operation)--> onunload event received for div1 --> onunload event received for div2-->onunload event received for div3 --> onunload event received for div4 --> redirection to webpage1.

Why its happening? Any clue please. This behavior is on Android mobile browser.

5 years ago
We have developed a android browser application (javascript) which keeps (every 3Sec) on sending a http (GET) request to my REST server (hosted on TOMCAT).

Everything works fine till the time phone is in operation. But as soon as phone is lying idle, the browser application's javascript stops sending the HTTP requests.

The phone is connected with our test WIFI router, and in the phone setting we have kept WIFI connected even if phone goes in the idle state.

We are capturing HTTP packets with wireshark on the REST server machine. Till the time phone is in working state, we recieve HTTP request packet but as soon we leave the phone (and it goes to idle state) idle, HTTP packets stops appearing on the Wireshark (however some TCP packets are visible).

The same behavior is there on IPhone device as well, Is it the default behavior of SmartPhone browsers?

Please help if someone have faced this kind of situation or have similar experience.

PS. on android, the browser we are using is the default browser and android version is 4.0.3
5 years ago
just to add, when we are trying to access the webservice (from Javascript) through HTTPS, its showing error as Access denied. But when we are accessing the same webservice (from Javascript) through HTTP, its working.

The above behavior is with JSP implementation running on Tomcat (not the standalone html page). SO, I suspect is it really the cross domain issue as you pointed.

you can;t make an Ajax request to a domain other then that which served the page.

In this case even the port needs to be same?? for eg. if the page on browser has been fetched from http://ip:8080/, then the other request for http://ip:8443/ is also subject to cross domain issue??

The code is the same javascript code but one is with plain HTML (not hosted on tomcat) and other is with JSP page. The later one is not working.

But in general, a webservice will always be hosted on some remote server and possibly placed on a different domain. The client JSP page will however work on local domain.

I have a JSP page hosted on tomcat and calls a web interface (webservice hosted on some other server) from javascript but it gives access denied issue.

However, when we use same JavaScript code which calls the webservice in a plain HTML page, it works. I am still unable to locate the problem, please help.

E Armitage wrote:Remove the notion of a session with your REST clients and treat every request as a new one containing all the information required to perform the requested operation.
It's already a bit square as it is and creating sessions in REST is just stretching the corners even more.

From REST services usability point it doesn't seems acceptable to burden client developer to pass extra parameters for every request.
5 years ago
My team is developing an REST service wrapper over an existing SOAP based web service. We don't exactly know the SOAP service internals, just have access to the WSDL file. Our REST service wrapper will be just one-to-one mapping.

I know in real its not adhere to REST philosophy, even though please allow me to call it REST services. This REST service will be deployed on Tomcat and many client will be accessing it concurrently.

The current implementation is that for each client we will be creating an proxy object (using SOAP WSDL proxy class). This proxy object will be used to call the SOAP APIs. The SOAP requires authentication details binding over the proxy objects, so we are saving these objects for each client in memory at runtime while making first REST call to establish a session.

The saved object is fetched at runtime using an SessionID identifier. Now the problem is these proxy object occupy large memory chunks and only few REST clients are supported. (With default 64 MB only 19 REST clients can run). This is the trouble now we want to change the approach and would require your suggestions.

Kindly let me know if any better solution exists. We don't want a DB to store the objects.
5 years ago
We have written a server application wrapper which internally uses the SOAP webservices. This server application runs on TOMCAT and should handle multiple clients.

In the current implementation, we used to create a proxy object (for SOAP service) for each client requesting to our server. The proxy object contains the bindingprovider information attached. This proxy object is created at the first call while requesting for startsession.

We used to save this proxy object along with the sessionID in the HashMap for any further request to the server application. So when next time a request comes, we used to fetch the respective service object from HashMap and this object was used to call the new SOAP API.

Now we are facing memory issue (outofMemory) because we save complete objects for each client. So at some point of time the Java memory gets full, if there are many clients working concurrently.

To avoid the same, we are wondering if we can create just one SOAP proxy object for all the clients and at runtime we just keep on changing the bindingprovider credentials value for the proxy object i.e. USERNAME_PROPERTY/PASSWORD_PROPERTY at runtime.

As this credentials needs to be present with proxy object for making every soap api request. Please suggest if we can go for this kind of approach.
5 years ago