HTTP POST on Device - error message

Discussion in 'Questions (Windows Mobile)' started by TWELVE, Apr 24, 2008.

  1. TWELVE

    TWELVE Active Member Licensed User

    Hello,

    i'm pretty new to Basic4PPC..:) I used the trial version to evaluate if this language is suitable for my project.Now i purchased the full version.In the very first time i tested my program on the device, but later i used only the emulator on windows desktop because it is much more comfortable.I'm using an HP IPAQ 5450 with PocketPC 2003.

    Until now everything went ok so far, but now i discovered an issue related to the HTTP lib.I use an HTTP POST to send data to a webserver, which was working fine on the desktop emulator.When i tried it on the device, i'm getting an error message:

    If i confirm the message, the programs continues to work, but after exiting the program i get another error message:


    After confirming this message Basic4PPC terminates.

    Using an network sniffer i can see, that the POST request is send to the server correctly, but the following message box with the error is preventing me from receiving/getting the server's response string.

    With desktop version / emulator everything works as expected, no error messages in that at all.

    I installed .Net CF 2, because the serial2.dll complaint about the CF 1.

    Other request, like GET or TRACE or OPTIONS are working fine, no error message.

    I calculate the content.length using StrLength(my POST DATA string) and compared the Content.Length in the HTTP Header with the number of characters in the network trace.I matches the content.length number.

    I need some help here to proceed with my project.Somehow i suspect the content.length to be the cause, but don't know what's wrong here.

    Furthermore i updated the HTTP Lib with the latest one, but did not make a difference.

    kind regards

    TWELVE
     
    Last edited: Apr 24, 2008
  2. klaus

    klaus Expert Licensed User

    There must be an error in your code, when running on the device.

    But you are missing a routine on your device to display error messages.
    Look at this:
    http://www.basic4ppc.com/forum/showthread.php?t=870

    Hope this will bring you a step forward.

    Best regards
     
  3. TWELVE

    TWELVE Active Member Licensed User

    It is the same code that runs without errors on the desktop.

    Nevertheless..i installed the mentioned enu-cabfile and get now this error message:

    The same code works fine, when used with GET instead of POST Request header.I also cannot understand the error message, because the mentioned command is the one that submits the request to the server..?


    kind regards

    TWELVE
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. TWELVE

    TWELVE Active Member Licensed User

    Hi Erel,

    this piece of code should reveal where the problem is.It always occurs with the POST method, all other methods ( GET, TRACE...) are working fine, as long as the server is supporting them.The issue only occurs on the device, on desktop everything is fine.



    I also attached the source file, which also includes a small gui for easy testing.



    regards

    TWELVE
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed User

  7. TWELVE

    TWELVE Active Member Licensed User

    Hi Erel,

    the fixed http lib did the trick.Thanks a million...!!!

    I can now proceed with my project, which already contains 1000+ lines of code.

    I assume nobody here used a POST within his programs yet..?

    cheers

    TWELVE
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice