Skip to main content

Need help

5 replies [Last post]
rferia
Offline
Joined: 2003-06-10
Points: 0

Hello folks,

Need your help - trying to retrieve data from a web-service to a Java ME device but it chokes after receiving a small amount of data. Sending is not an issue. I'm posting in behalf of some students and here's what they say

"We think that the problem is caused by the processing limitations of the j2me web service.

With our observations, we think that there is a limit in the capacity of the data that could be retrieved by the invoke method that is called by the j2me web service stub. As we have said, we could retrieve 1-2 seconds audio recording. Greater than 2 seconds, the object returned by the invoke method in the stub is null."

Just want to confirm if there is indeed a limit.

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

Shawn brings up a good point. On a typical cellular network standard Internet protocols like sockets and HTTP are not directly supported but implemented via gateways that translate Internet protocols to the appropriate wireless bearer protocols and back. Unfortunately, the implementations of these gateways varies and sometimes is incomplete and/or buggy, for example by truncating HTTP headers or inserting and removing information.

Have you tried your web-service test on a different network/operator? You might be running into a limitation of the gateways or protocol converters.

-- Terrence

rferia
Offline
Joined: 2003-06-10
Points: 0

It might be - but the apps are still running on emulators and within the local network. I think "chunking" is the only way to go.

sfitzjava
Offline
Joined: 2003-06-15
Points: 0

This sounds like an issue I had but in the reverse direction.
Try writting buffer of 1024 bytes out.

OutputStream out = response.getOutputStream();
byte[] buf = new byte[1024];
int len = buf.length;
//.... fill buffer ...
while( moreToWrite)
{
out.write(buf,0,len);
// .... fill buffer ..
// .... set len = #of bytes
// .... if no more data
// moreToWrite = false;
}
out.flush();
out.close();

You get the idea. Trying to blast 3.5M of data causes the pipe to timeout and the socket to
reset by the webserver since the device can't handle that much data on a sustained write.

-Shawn

terrencebarr
Offline
Joined: 2004-03-04
Points: 0

I seem to remember there was a similar question on our forums a little while back, but I can't seem to find it. Would you mind searching the forums again?

Thanks,

-- Terrence

karmington
Offline
Joined: 2007-08-09
Points: 0

i seem to recall many references to 'chunking' in j2meforums, which is down right now (august07), which was probably being done to bypass the problem.

sending bytestream data we have not yet found a ceiling for it, but we are not sending usually more than 1000 characters worth of data...