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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:55:27+00:00 2026-05-26T14:55:27+00:00

I am developing a sample application to call .Net web services. I have added

  • 0

I am developing a sample application to call .Net web services. I have added ksoap2-j2me-core-prev-2.1.2.jar to the build path in Eclipse.

I am passing two values via addProperty: “number1” and 10 as integer, and also “number2” and 20. This causes a compiler error:

The method addProperty(String, Object) in the type SoapObject is not applicable for the arguments (String, int)

How can I resolve the error and how can I pass one string and one int value to addProperty? I have done this the same way in Android and it is working fine there.

    String serviceUrl = "URL to webservice";
    String serviceNameSpace = "namespace of web service";
    String soapAction = "URL to method name";
    String methodName = "Name of method";
    SoapObject rpc = new SoapObject(serviceNameSpace, methodName);

    //compiler error here
    rpc.addProperty("number1", 10);
    rpc.addProperty("number2", 20);

    SoapSerializationEnvelope envelope = new  SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.bodyOut = rpc;
    envelope.dotNet = true;//IF you are accessing .net based web service  this should be true
    envelope.encodingStyle = SoapSerializationEnvelope.ENC;
    HttpTransport ht = new HttpTransport(serviceUrl);
    ht.debug = true;
    ht.setXmlVersionTag("");
    String result = null;
    try
    {
    ht.call(soapAction, envelope);
    result = (String) (envelope.getResult());
    }
    catch(org.xmlpull.v1.XmlPullParserException ex2){
    }
    catch(Exception ex){
    String bah = ex.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-26T14:55:28+00:00Added an answer on May 26, 2026 at 2:55 pm

    You need to be aware that BlackBerry development is done with Java-ME, while Android development is done with Java-SE. In Java, primitives are not objects. Primitives are values like double, int, float, char.

    You can’t pass a primitive where an object is expected, even in Android. The reason your code works in Android is because of a feature added to Java-SE that isn’t in Java-ME, called auto-boxing.

    You can get primitives to be like objects by wrapping them. That is what the Double, Integer, Float and Character classes do. In Java SE, when the compiler sees a primitive being passed as an Object argument, it automatically converts to the wrapped, or “Boxed” version. This feature doesn’t exist in Java-ME, so you have to do the boxing yourself. In this case, that means:

    rpc.addProperty("number1", new Integer(10));
    rpc.addProperty("number2", new Integer(20));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an IOS application, which uses web services (SOAP/WSDL). I have built
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I am developing a web application that calls web services developed by a third
I am developing an asp.net mvc web application that makes much use of jquery
I am developing a sample application, where I have a situation for moving a
I have a Java web application I’m developing for a school project. There’s a
I'm developing a simple web application where in I need to display number a
I am developing a simple ASP.Net application on a Windows 7 x64 machine using
I have a simple application using netbeans for developing and maven for building et
I'm developing an application (winforms C# .NET 4.0) where I access a lookup functionality

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.