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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:03:34+00:00 2026-06-06T03:03:34+00:00

I’m making an app that is requesting data from a Web Service (implementing Soap).

  • 0

I’m making an app that is requesting data from a Web Service (implementing Soap).

People who are viewing this pleaase post doubts in comments… I havent got any response to the question do ask me if there is any doubts, i really need help, am stuck!!

So to make request I have to use ksoap libraries.. the Web service is coded to return a response of type XML. When the web service itself is tested on a browser it displays a result which is as follows:

?xml version="1.0" encoding="utf-8" ?> 
- <SOBKeyList>
- <Key>
  <value>12686</value> 
  </Key>
- <Key>
  <value>16238</value> 
  </Key>
- <Key>
  <value>26978</value> 
  </Key>
  </SOBKeyList>

clearly an XML file…

However when i use ths code to get a result:

    public String getXmlFromUrl(String url) {
    // TODO Auto-generated method stub
    String xml = null;
    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
    PropertyInfo pi = new PropertyInfo();

    pi.setName("fkey");
    pi.setValue(0);
    pi.setType(Integer.class);
    request.addProperty(pi);

    pi = new PropertyInfo();

    pi.setName("tkey");
    pi.setValue(999999);
    pi.setType(Integer.class);
    request.addProperty(pi);


    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE httpTransport = new HttpTransportSE(url);
    Object response = null; 

    try {
        httpTransport.call(SOAP_ACTION, envelope);
        response = envelope.getResponse();
        xml = response.toString();
        Log.d("xml:", xml);
    } catch (SoapFault e) {
        // TODO Auto-generated catch block
        Log.d("Soap Fault", e.toString());
    } catch (IOException e) {
        // TODO Auto-generated catch block
        Log.d("IOexception", e.toString());
    } catch (XmlPullParserException e) {
        // TODO Auto-generated catch block
        Log.d("XmlPullParserException", e.toString());
    }

    return xml;
}

It returns a nested SOAP structure confirmed by the Log entry which i make ( Log.d("xml:", xml); )
The corresponding LogCat entry is: (i’ve formatted it to make it the SOAP structure’s heirarchy apparent… )

anyType{
      SOBKeyList=anyType{
                          Key=anyType{value=12686 ; };
                          Key=anyType{value=16238 ; };
                          Key=anyType{value=26978 ; };
                         };
          }

The reason why i necessarily need an XML is because later I parse the string to get a DOM element and when the above string is passed it returns the following:

org.xml.sax.SAXParseException: Unexpected token (position:TEXT anyType{SOBKeyLi…@1:119 in java.io.StringReader@40ec9c68)

also from there onward my entire code depends on the fact that the response was XML.

Explaination of the reason why i expected an XML :
Now you may asked why I coded my app expecting XML when i had not tested the Web service the reason is: The Web service was coded my a third party who assured me of an XML response , now i dont have enough time to change my remaining code to exploit a SOAP structure !!
-_-
I’m in a fix. Please help!

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

    Try this:

    String responseXML = httpTransport.responseDump;
    
    • HttpTransportSE.responseDump gives you response in XML format.
    • HttpTransportSE.requestDump gives you request in XML format.

    However to be able to change and retrieve any of these values you must set the debug field of HttpTransportSE to true
    so your code should look like…

        HttpTransportSE httpTransport = new HttpTransportSE(url);
        httpTransport.debug =true;      
        try {
            httpTransport.call(SOAP_ACTION, envelope);          
            xml = httpTransport.responseDump;
            Log.d("xml:", "is:" + xml);     
        }
    

    Also you can parse your response like as follow:

    ArrayList<String> listValues = new ArrayList<String>();
    
                httpTransport.call(SOAP_ACTION, envelope);
                SoapObject response = (SoapObject) envelope.getResponse();
    
                SoapObject soapSOBKeyList = (SoapObject) response.getProperty("SOBKeyList");
    
                int keyCount = soapSOBKeyList.getPropertyCount();
    
                for (int i = 0; i < keyCount; i++) {
                    String value = soapSOBKeyList.getPropertyAsString(i);
                    listValues.add(value);
                }
    
                return listValues;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.