×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    39

    Unhappy 81-Error in HTTP operation

    Hi,

    i have a Midlet that connect to internet by HttpConnection. Ist work fine (in germany). But now I would start the application in the country luxemburg. Then comes a java.lang.Exception "81-Error in HTTP operation". But I can go with the Browser on the Nokia-device to e.g. http://www.google.de ?!?!?! But my MIDlet doesnt work??? Why?

    Anybody an idea?

    Thanks!

    Here my sourcecode:

    Code:
     HttpConnection connection = null;
            InputStream inputstream = null;
            try {
                connection = (HttpConnection) Connector.open("http://www.google.de");
    
                connection.setRequestMethod(HttpConnection.GET);
                //connection.setRequestProperty("Content-Type", "//text plain");
                connection.setRequestProperty("Connection", "close");
    
                System.out.println("Status Line Code: " + connection.getResponseCode());
                System.out.println("Status Line Message: " + connection.getResponseMessage());
    
                if (connection.getResponseCode() == HttpConnection.HTTP_OK) {
                    System.out.println(connection.getHeaderField(0) + " " + connection.getHeaderFieldKey(0));
                    System.out.println("Header Field Date: " + connection.getHeaderField("date"));
    
                    String str;
                    inputstream = connection.openInputStream();
                    int length = (int) connection.getLength();
                    if (length != -1) {
                        byte incomingData[] = new byte[length];
                        inputstream.read(incomingData);
                        str = new String(incomingData);
                    } else {
                        ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
                        int ch;
                        while ((ch = inputstream.read()) != -1) {
                            bytestream.write(ch);
                        }
                        str = new String(bytestream.toByteArray());
                        bytestream.close();
                    }
    
                    getAlert().setString(str);
                    switchDisplayable(getAlert(), getDisplay().getCurrent());
                    System.out.println("Text :" + str);
                }
            } catch (Exception error) {
                getAlert().setString("FEHLER: " + error.getMessage());
                switchDisplayable(getAlert(), getDisplay().getCurrent());
                System.out.println("Caught IOException: " + error.toString());
            } finally {
                if (inputstream != null) {
                    try {
                        inputstream.close();
                    } catch (Exception error) {
                        /*log error*/
                    }
                }
                if (connection != null) {
                    try {
                        connection.close();
                    } catch (Exception error) {
                        /*log error*/
                    }
                }
            }

  2. #2
    Registered User
    Join Date
    Jun 2009
    Posts
    39

    Unhappy Re: 81-Error in HTTP operation

    Nobody an idea?

    Has a MIDlet a country-value or else?

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    39

    Re: 81-Error in HTTP operation

    Has anybody an Midet or an Nokia app that connect to internet and is made for luxembourg? Or for france?

    Please need help!

  4. #4
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    53

    Re: 81-Error in HTTP operation

    HttpConnection should work normally. Can you do one thing. Create a Servlet for handling the request from the mobile. Deploy the project in any public ip, try connecting from the mobile using get/post. Use the sample HttpConnection code coming with WTK at client side.

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    39

    Smile Re: 81-Error in HTTP operation

    OK, i found the solution!

    It was a problem by my provider.

    Thanks all!
    (And thanks aj4mobile)

  6. #6
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    Re: 81-Error in HTTP operation

    Hi Herbutinde, i have exactly the same problem trying to deploy my app on Panama, it usually works on USA.
    could you detail more about the problem was your provider has? to contact my provider and try to fix my problem the same way.

    Thanks n advance

Similar Threads

  1. IO exception in HTTP operation
    By J2me_champ in forum Mobile Java General
    Replies: 7
    Last Post: 2009-10-12, 17:56
  2. cancel http operation
    By badzio in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2009-05-21, 22:52
  3. IO exception in HTTP operation
    By J2me_champ in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-03-10, 09:02
  4. Error in HTTP operation
    By fethy in forum Mobile Java General
    Replies: 10
    Last Post: 2007-08-30, 11:53
  5. error in http operation on 6822
    By samy_rdissi in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-06-28, 17:23

Posting Permissions

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