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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:43:36+00:00 2026-06-04T03:43:36+00:00

i already done with my asmx which developed by using .net c# and it

  • 0

i already done with my asmx which developed by using .net c# and it works well

but i found a error when i need to call the by using java android
error: java.lang.ClassCastException:org.ksoap2.serialization.SoapObject cannot be cast to org.ksoap2.serialization.SoapPrimitive

result displayed at my asmx:

<customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<customerID>1</customerID>
<companyName>ABC</companyName>
<contactName>Jack</contactName>
<customerID>2</customerID>
<companyName>SS Company</companyName>
<contactName>Mary</contactName>
</customer>

my java cs:

        public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tv = (TextView)findViewById(R.id.textView1);

        SoapObject Request = new SoapObject (NAMESPACE, METHOD_NAME);
        Request.addProperty("custID", "member");

        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        soapEnvelope.dotNet = true;
        soapEnvelope.setOutputSoapObject(Request);

        AndroidHttpTransport aht = new AndroidHttpTransport(URL);

        try
        {
         aht.call(SOAP_ACTION, soapEnvelope);
        SoapObject resultString = (SoapObject) soapEnvelope.getResponse();
        tv.setText(resultString.toString());
        }
        catch(Exception e)
        {
            tv.setText(e.toString());          
        }                 
    }

the code above is functioning if i use http://www.w3schools.com/webservices/tempconvert.asmx

  • 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-04T03:43:37+00:00Added an answer on June 4, 2026 at 3:43 am

    I have solved it

               SoapObject resultString = (SoapObject) soapEnvelope.getResponse();           
    
                String addon = "";
                for(int i =0;i<resultString.getPropertyCount();i++)
                {                            
                    SoapObject array2 = (SoapObject) resultString .getProperty(i);              
                    addon = (addon + "ID = " + array2.getProperty(0).toString() + array2.getProperty(1).toString() + array2.getProperty(2).toString() + "\n");  
                }
                tv.setText(addon.toString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to calculate prime numbers, which I've already done. But I want
Hey! This is what I have already done so far which works great: Download
I am doing project in vb.net which is already done in vb6 I am
I need to construct a tree in Java. I am already done with tree
When using PDO, do i still need to addslashes or is this done already
My ASMX call is returning Content-Type = text/xml; charset=utf-8 I am using ASP.NET 3.5
We need to redo a database in MySQL that has been already done on
Already found this page with some helpful hints. Problem is I need to debug
Alright, i had this homework recently (don't worry, i've already done it, but in
I have to do phone number validation using JavaScript. I have already done validation

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.