×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    4

    Problem In calling http request by 9500

    Hi all,

    I am trying to http request by Nokia 9500,

    But MIDP application unable to start GPRS connecting(not even ask for connecting) and connect to the web.

    AS the Application call http request then Applivation get Exit.

    Aleart comes

    Program : Main
    Reason code : USER
    Reason number : 10


    Is there any setting with Nokia 9500 so that It will Start GPRS connection.


    thanks in advance

    Vinay

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Problem In calling http request by 9500

    Can you post the code?

    Daniel

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    4

    Re: Problem In calling http request by 9500

    Hi Daniel

    This is the coding part App closes at
    hc = (HttpConnection)Connector.open(url);

    on Nokia 9500 and 6600

    Is any sis file need to be install to run MIDP Web app on 9500??

    Because Application is not colling GPRS connection.

    What to do ??




    String message = "name=Vinay+j%21";

    backupForm.append("Connecting");
    hc = (HttpConnection)Connector.open(url);
    backupForm.append("Connected");
    hc.setRequestMethod(HttpConnection.POST);
    backupForm.append("setted Request Method");
    hc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    hc.setRequestProperty("Content-Length",Integer.toString(message.length()));

    out = hc.openOutputStream();

    out.write(message.getBytes());

    in = hc.openInputStream();

    int length = in.available();
    byte[] data = new byte[length];

    String response = new String(data);
    backupForm.append(response);



    ____Vinay

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Problem In calling http request by 9500

    No, you don't need a sis file to run a midp application in 9500, the jar will do just fine.

    The error code you're getting means, according to the Symbian SDK documentation:

    "This panic is raised when the position value passed to a 16 bit variant descriptor member function is out of bounds. It may be raised by the Left(), Right(), Mid(), Insert(), Delete() and Replace() member functions of TDes16.
    "

    It talks about Symbian code actually, but it is a good hint because you are creating a String from a byte array in

    int length = in.available();
    byte[] data = new byte[length];
    String response = new String(data);

    but if "length" is < 0, then the data byte array will be of negative size, and that will cause a panic in the application, and it will be close.

    in.available() is very known for being buggy, so you should change it to something like:

    StringBuffer sb = new StringBuffer();
    int c;
    while((c=in.read())!=-1) {
    sb.append((char)c);
    }

    String response = sb.toString();

    Hope it helps.

    Daniel

Similar Threads

  1. symbian OS error: 33 and 5120 in http Request
    By corej2me in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-08-17, 13:40
  2. Nokia 3510i http request problem
    By icrni in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-11-18, 14:29
  3. Open a HTTP Get request and displaying HTML-Source Code
    By edmund66 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-10-01, 13:41
  4. Problem with Authentication filter in HTTP Client API on Series 60 2.x
    By william_j in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-09-06, 13:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×