Problem with HTTP GET method


#1

I am using HTTP GET method to download a file with the WMP100. But I’m experiencing a very frustrating problem.

I set up the channels with following:

http_channel = wip_HTTPClientCreateOpts (NULL, NULL,
WIP_COPT_HTTP_VERSION, WIP_HTTP_VERSION_1_0,
WIP_COPT_HTTP_HEADER, “Host”,
MyUrl,
WIP_COPT_END);

data_channel = wip_getFileOpts (http_channel, MyDestinationUrl,
httpEventHandler, NULL,
WIP_COPT_HTTP_METHOD, WIP_HTTP_METHOD_GET,
WIP_COPT_END);

Then in httpEventHandler I get WIP_CEV_OPEN, followed by WIP_CEV_READ if all works well.

The problem is that sometimes WIP_CEV_READ would never come. The WIP_CEV_OPEN event always occurs but then no other events follows after it. Then I reboot the WMP and re-connect to GPRS and all of a sudden the WIP_CEV_OPEN event comes in perfectly. I can not understand why the WIP_CEV_READ event sometimes occurs and other times not.

Has anyone else experienced the same?


#2

In wavecom’s example it mentions that you have to read all data from the buffer when a WIP_CEV_READ event comes otherwise you don’t trigger the next event. Are you certain you do so?


#3

The problem is that it does not even get the WIP_CEV_READ event. Just the WIP_CEV_OPEN event fires and then nothing else.

I have made a kind of work-around by having a timer that checks if the nothing else happens after WIP_CEV_READ for 30 seconds, then it disconnects GPRS and try again and again. It usually works after a couple of tries. Its just just ugly and slow.


#4

I’m convinced there is a problem with HTTP GET. This problem was giving us so much problems that we finally decided to use HTTP POST method instead to download the file. This did require us to write a small server side app that would read the file and stream it back as server response. This works very well. The only change we made to our WMP100 code was to change from GET to POST.

I am still interested to know why HTTP GET did not work as expected, but at least HTTP POST is working correctly.


#5

I had problems with HTTP GET because the Wavecom documentation was (maybe still is?) wrong about what events you get, and when. :angry:

Sorry I don’t have time to dig it out at the moment, but try a search here on “WIP_CEV_” - I think I posted about it…