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

  • Home
  • SEARCH
  • 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 7949027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:52:53+00:00 2026-06-04T01:52:53+00:00

I need to get a http status code from ksoap response to specify exceptions

  • 0

I need to get a http status code from ksoap response to specify exceptions like 403-unauthorized (I use client certificates for authentication – when a certificate is not valid).
I was trying to find a http status within ResponseProperties (where it should be I think), but I didn’t.

Code:

...
HttpsTransportSE transport=new HttpsTransportSE(host, port, service, timeout);
try {
  SoapObject request=new SoapObject(namespace, method);
  request.addProperty("param", param);

  SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
  envelope.dotNet=true;
  envelope.setOutputSoapObject(request);

  transport.call(getStatusAction, envelope);
  SoapPrimitive response=(SoapPrimitive)envelope.getResponse();
  nRet=Integer.parseInt(response.toString());
}
catch(Exception e) {
  // Here I can get HeaderProperties by transport.getConnection().getResponseProperties();
  // But http status code is not present
  e.printStackTrace();
}
...

Thanks.

  • 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-06-04T01:52:55+00:00Added an answer on June 4, 2026 at 1:52 am
        URL myurl = new URL(url);
        URLConnection connection = myurl.openConnection();
        connection.setConnectTimeout(20 * 1000);
        HttpURLConnection httpConnection = (HttpURLConnection) connection;
        int responseCode = -1;
    
        if (responseCode == HttpURLConnection.HTTP_OK)
        {
            httpConnection.disconnect();
            SoapObject request = new SoapObject(namespace, methodName);
            //...
        }
        else if(...)
        {
            //...
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read the response from an HTTP GET in situations where the
I need to get currency values list in C# from here: http://openexchangerates.org/currencies.json which produces
I use file_get_contents(http://www.mydomain.com); to get the content. Then I need to search through it
I use asp.net 2 and need to consume a 3rd party HTTP GET call
i need help at get a given project running. The project is: http://code.google.com/p/opennetinf/ I
I need to read binary file from intranet http server and get it to
Say I'm sending some HTTP status code in PHP, do I actually need to
I need to get values of these check boxes with same name through HTTP
In AS2, I need to get a URL. In the header of the HTTP
I need to make an HTTP request to get back translated text. If I

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.