Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6897355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:09:31+00:00 2026-05-27T07:09:31+00:00

I am developing an application to use httpconnection to get some data to a

  • 0

I am developing an application to use httpconnection to get some data to a .Net Webservice. The code is working fine when i host the webservice locally and test it with Eclipse simulator, but when i host the webservice on the public deployment server and package the Blackberry app to my device all am getting is is a respose code 500. Please can someone give me a clue, an answer or a solution to what migth be causing this?

Below are the code i used:

String URL = WebServiceURL+"/Login"+getConnectionParameter();

public static String getConnectionParameter() {
    String ConnectionParameter ="" ;
    if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
        // Connected to a WiFi access point
        ConnectionParameter = ";interface=wifi";
    } else {
        int coverageStatus = CoverageInfo.getCoverageStatus();
        ServiceRecord record = getWAP2ServiceRecord();
        if (record != null && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {
            // Have network coverage and a WAP 2.0 service book record
            ConnectionParameter = ";deviceside=true;ConnectionUID="+ record.getUid();
        } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS) {
            // Have an MDS service book and network coverage
            ConnectionParameter = ";deviceside=false";
        } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {
            // Have network coverage but no WAP 2.0 service book record
            ConnectionParameter = ";deviceside=true";
        }
    }
    return ConnectionParameter;
}

URLEncodedPostData oPostData = new URLEncodedPostData(
                URLEncodedPostData.DEFAULT_CHARSET, false);
                oPostData.append("username",username.getText());
                oPostData.append("compressedpicture",HomeScreen.convertByteArrayToString(imageArray));
                oPostData.append("email",email.getText());
                oPostData.append("password",password.getText());
                oPostData.append("pin",pin.getText());
                oPostData.append("extension",extension);
                String URL = MYAPP.WebServiceURL+"/SignUp"+MYAPP.getConnectionParameter();
                String result = HomeScreen.postinfo(URL,oPostData);
                Dialog.inform(result);
                if(result.indexOf("success")!= -1){
                    Dialog.inform("You Have just sign up. Congratulations.");
                }else{
                    Dialog.inform("There is an issue registering you"); 
                }




public static String postinfo(String _URL,URLEncodedPostData _PostData) {
    String result = "";
    try {
        HttpConnection conn = (HttpConnection) Connector.open(_URL,
                Connector.READ_WRITE);
        if (_PostData != null) {
            conn.setRequestMethod(HttpConnection.POST);
            conn.setRequestProperty("Content-type",
                    "application/x-www-form-urlencoded");
            conn.setRequestProperty("Content-Length",
                    Integer.toString(_PostData.size()));
            OutputStream strmOut = conn.openOutputStream();
            strmOut.write(_PostData.getBytes());
            strmOut.close();
        } else {
            conn.setRequestMethod(HttpConnection.GET);
        }

        int responseCode = conn.getResponseCode();
        if (responseCode == HttpConnection.HTTP_OK) {
            InputStream data = conn.openInputStream();
            StringBuffer raw = new StringBuffer();
            byte[] buf = new byte[4096];
            int nRead = data.read(buf);
            while (nRead > 0) {
                raw.append(new String(buf, 0, nRead));
                nRead = data.read(buf);
            }
            result = raw.toString();
            //Dialog.alert("Result:" + raw.toString());
            //_Dest.updateDestination(raw.toString());
        } else {

            _Dest.updateDestination("responseCode="
                    + Integer.toString(responseCode));
            result = "responseCode= "+ Integer.toString(responseCode);
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        //_Dest.updateDestination("Exception:" + e.toString());
        result = "Exception:" + e.toString();
    }
    return result;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:09:32+00:00Added an answer on May 27, 2026 at 7:09 am

    Thanks for all your suggestion Guys. I appreciate them all. I discovered my production server was throwing the internal server error 500 because of of the /WebserviceMethod at end of my URL e.g.

    String URL = WebServiceURL+"**/Login**"+getConnectionParameter();
    

    I found a solution using KSOAP2. It worked perfectly well. Though u might av to write some lines of code to handle the parsed response format(KSOAP2 return a parsed format of the response XML).

    Am sure you will find the article at this link useful:
    KSoap Android Web Service Tutorial With Sample Code

    It applies to most J2ME based mobile platform.

    Once again Thank you all for your time and help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing ASP.net application which use web services. There are no data base connections
I am developing an application using Asp.net mvc and jquery. I'd like to use
I have been developing Android application where I use this code: Date d=new Date(new
I am developing an application with ASP.NET MVC and wish to make use of
I'm developing an application, that makes use of some REST web services. It's technical
iam developing one application.In that i use the search bar for search the data.But
I'am developing application based on apache MINA. For secure data transmission I use SSL.
I'm developing an application which make use of display lists offered by OpenGL. My
I am developing an application that needs to use regini (because of legacy reasons)
I am developing an iPhone application and I use HTML to display formatted text.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.