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 6711881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:11:36+00:00 2026-05-26T08:11:36+00:00

So I’m using an AsyncTask to perform a call to my windows WCF service.

  • 0

So I’m using an AsyncTask to perform a call to my windows WCF service. So far it has gone great, I can get it to call a method that returns a string and display it within the application. But when trying to methods that return a bool i get some errors..

Code

RegisterSeatTask task = new RegisterSeatTask();
task.execute(this);

protected class RegisterSeatTask extends AsyncTask<Context, Integer, String> {
    protected String doInBackground(Context... arg0) {
try {
......
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());

if (!LicenseHandler.RegisterSeat(licenseKey, ident,android.os.Build.DEVICE,tm.getDeviceId())) {
                    return "License is invalid or does not have any empty seats!";
}
......
}
protected void onPostExecute(String result) {
        Toast.makeText(getBaseContext(), result, Toast.LENGTH_LONG).show();
    }
}

public static boolean RegisterSeat(String License, String Identifier,
        String Device, String DeviceID) {
    try {

        METHOD_NAME = "RegisterSeat";
        SOAP_ACTION = "http://tempuri.org/IService/RegisterSeat";

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

        request.addProperty("License", License);
        request.addProperty("MyIdentifier", Identifier);
        request.addProperty("Device", Device);
        request.addProperty("DeviceID", DeviceID);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        androidHttpTransport.call(SOAP_ACTION, envelope);
        SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
        if (result.toString().toLowerCase() == "true") {
            return true;
        }
        // to get the data
        return false;
    } catch (Exception e) {

        return false;
    }

}

However everytime i run the method RegisterSeat() the code stops and ends up on the last line inside the Catch() like this and e is null.. There are no expcetions cast?
I can see the value of result.tostring() it is either true or false as the wcf returns it. But somewhere everything bugs out and I don’t know what to make of it :/!!

like this
e is null
I can see the value of result.tostring()

  • 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-26T08:11:37+00:00Added an answer on May 26, 2026 at 8:11 am

    one thing I would note is that you should be using .equals(“true”) rather than “== true” to compare your strings

    glad it worked 🙂

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.