×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    HttpConnection Post method request

    Hello,
    I am trying to send data from Nokia6230(Series40)through HttpConnection post method. But the server not receive any data which is sended from handset. I have a question.
    Q. Series 40 handset is supported HttpConnection Post method or not supported?

    Please help me.

    Thank You.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: HttpConnection Post method request

    S40 supports HttpConnection post method.

    Try on emulator, try with GET and see if your request is hitting the server or not?

    In post is the server hit? if yes then letus know how are you writing the Post data and who are you reading it on the server side?

    thanks,
    ~Amitabh

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Re: HttpConnection Post method request

    Quote Originally Posted by im2amit View Post
    S40 supports HttpConnection post method.

    Try on emulator, try with GET and see if your request is hitting the server or not?

    In post is the server hit? if yes then letus know how are you writing the Post data and who are you reading it on the server side?

    thanks,
    ~Amitabh
    Thank you Amitabh for your reply.

    I am tried on emulator its work. But when I am install application on Nokia6230 the application not work properly means I am sending data to the server(.aspx page) and (page) server send response to the phone. I show the server response in the alert but it shows empty alert box.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: HttpConnection Post method request

    Put some SOP's on the server code and see if you are getting the required data from the mobile request on the server, and check if the server is writing back the correct needed info to the response if yes, then we need to check the mobile client code else server side scrip.

    thanks,
    ~Amitabh

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Re: HttpConnection Post method request

    hC = (HttpConnection) Connector.open(url);
    oS = hC.openOutputStream();
    //----------------
    // Client Request
    //----------------
    // 1) Send request type
    hC.setRequestMethod(HttpConnection.POST);
    // 2) Send header information. Required for POST to work!
    hC.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    // If you experience connection/IO problems, try
    // removing the comment from the following line
    // http.setRequestProperty("Connection", "close");
    // 3) Send data/body
    // Write account number
    System.out.println("Sending is "+abc);
    byte data[] = abc.getBytes();
    oS.write(data);
    oS.close();
    // For 1.0.3 remove flush command
    // See the note at the bottom of this file
    // oStrm.flush();
    //----------------
    // Server Response
    //----------------
    iS = hC.openInputStream();
    int length = (int) hC.getLength();
    byte incomingData[] = new byte[length];
    iS.read(incomingData);
    str12 = new String(incomingData);
    System.out.println ("DAta is "+str12);
    //connectionCondition("SUCCESS", 0);
    backup.showAlert("ContactExport10", str12, 1);

    This is client side code.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: HttpConnection Post method request

    Hello,
    Are you sure that you can open the default browser of the device and it is opening some demo page lets called it as http://google.com
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Re: HttpConnection Post method request

    Quote Originally Posted by raj_J2ME View Post
    Hello,
    Are you sure that you can open the default browser of the device and it is opening some demo page lets called it as http://google.com

    Yes the application read data from google page. The application work properly on Nokia5800(Series 60). But in the Nokia6233 it doesn't work properly.

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: HttpConnection Post method request

    Quote Originally Posted by kishorpingale View Post
    But in the Nokia6233 it doesn't work properly.
    What does not work properly?
    Are you not able to open the device's browser and browse some web page on that?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Re: HttpConnection Post method request

    Quote Originally Posted by raj_J2ME View Post
    What does not work properly?
    Are you not able to open the device's browser and browse some web page on that?
    Hello raj_J2ME,
    I am using HttpConnection POST method for data sending and receiving between the client and server(.aspx page). When client side send data like "Hello How are you" to the server(.aspx page) it would send response "SUCCESS" string . The series 60 handset shows the "SUCCESS" string in alert box. But in Series 40 handset does not write data to the server(.aspx page) and it shows empty alert box.

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: HttpConnection Post method request

    Are you able to open device browser on your S40 device and access google.com?

    in Series 40 handset does not write data to the server(.aspx page) and it shows empty alert box.
    Does S40 able to make the server call? put SOP server side or wireshark and check if you get the hit to your server or not.

    Check, which APN is used by the S40 in settings for your application?

    thanks,
    ~Amitabh

  11. #11
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Re: HttpConnection Post method request

    Quote Originally Posted by im2amit View Post
    Are you able to open device browser on your S40 device and access google.com?



    Does S40 able to make the server call? put SOP server side or wireshark and check if you get the hit to your server or not.

    Check, which APN is used by the S40 in settings for your application?

    thanks,
    ~Amitabh
    Answer to the your first question Yes. The application read the html tag of google page.

  12. #12
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: HttpConnection Post method request

    how about other Q?

    Does S40 able to make the server call? put SOP server side or wireshark and check if you get the hit to your server or not.

    Check, which APN is used by the S40 in settings for your application?

    thanks,
    ~Amitabh

  13. #13
    Registered User
    Join Date
    Dec 2008
    Posts
    17

    Smile Re: HttpConnection Post method request

    Hello,

    Thanks to everyone who gave me suggestions. The problem is solved. The problem was related to the GPRS.


    Thank You.


    Regards,
    Kishor Pingale

Similar Threads

  1. Send POST Request not working HELP!
    By ossedk in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-09-29, 12:45
  2. HTTP Post request structure
    By alav in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2008-08-12, 10:49
  3. KErrCorrupt in a HTTP Post request
    By deepka in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-06-24, 14:06
  4. Making Http Post in J2me (HttpConnection)
    By lekkie in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2007-02-14, 16:08

Posting Permissions

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