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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:59:27+00:00 2026-06-11T22:59:27+00:00

Background: I have followed the tutorial at: http://drclawx.wordpress.com/2011/06/24/77/ I only managed to get to

  • 0

Background:

I have followed the tutorial at: http://drclawx.wordpress.com/2011/06/24/77/

I only managed to get to the hello(msg) method to work by using:

 String NAMESPACE = "http://tempuri.org/" // instead of tempuri.org (no slash)
 private static final int SOAP_VERSION = SoapEnvelope.VER11;

However for the regular helloWorld I get the following and I really have no idea why…

 org.xmlpull.v1.XmlPullParserException:unexpected type(position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@40570bf8

I have also used: android-ws-client and generated stub files, and android libs and tried to use that in my project. I have it all setup but when I run it I get a status 404 being returned and thus an empty response and I don’t know why.

So I tried to start using ksoap2-android…

I have also spent a lot of time on stack overflow trying to find links to tutorials and other suggestions.

Problem:

The WSDL file I am working with is fairly complex – I want to be able to use one of the methods from it – using KSoap2-android – but I’m confused as to what to specify as namespace, soap_action, url etc. (My attempt is below the WSDL definitions).

Please take a look at the following WSDL file:

This wsdl file is located at: http://bcgdev4.bcg.local:12970
(You will not be able to load the link above, so please refer to the wsdl below):

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://prometheus" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://tempuri.org/" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="Commandor" targetNamespace="http://prometheus">
<wsdl:import namespace="http://tempuri.org/" location="http://bcgdev4.bcg.local:12970/?wsdl=wsdl0"/>
<wsdl:types/>
<wsdl:service name="Commandor">
<wsdl:port name="NetTcpBinding_ICommands" binding="i0:NetTcpBinding_ICommands">
<soap12:address location="net.tcp://bcgdev4:11970/"/>
<wsa10:EndpointReference>
<wsa10:Address>net.tcp://bcgdev4:11970/</wsa10:Address>
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
<Spn>host/BCGDEV4.BCG.local</Spn>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_ICommands" binding="i0:BasicHttpBinding_ICommands">
<soap:address location="http://bcgdev4.bcg.local:13970/mobile"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Right after where the first tag ends- you will see:

<wsdl:import namespace="http://tempuri.org/" location="http://bcgdev4.bcg.local:12970/?wsdl=wsdl0"/>

At http://bcgdev4.bcg.local:12970/?wsdl=wsdl0 – you will get the following wsdl definition:

You won’t have access to this either, so please look below:

I want to access the method RunCommandMobile which takes a string and returns a string.

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="NetTcpBinding_ICommands_policy">
<wsp:ExactlyOne>
<wsp:All>
<msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
<msf:ProtectionLevel>EncryptAndSign</msf:ProtectionLevel>
</msf:WindowsTransportSecurity>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<msf:Streamed xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy"/>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://bcgdev4.bcg.local:12970/?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://bcgdev4.bcg.local:12970/?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ICommands_RunCommand_InputMessage">
<wsdl:part name="parameters" element="tns:RunCommand"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommand_OutputMessage">
<wsdl:part name="parameters" element="tns:RunCommandResponse"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandCompress_InputMessage">
<wsdl:part name="parameters" element="tns:RunCommandCompress"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandCompress_OutputMessage">
<wsdl:part name="parameters" element="tns:RunCommandCompressResponse"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandMobile_InputMessage">
<wsdl:part name="parameters" element="tns:RunCommandMobile"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandMobile_OutputMessage">
<wsdl:part name="parameters" element="tns:RunCommandMobileResponse"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandMobileCompress_InputMessage">
<wsdl:part name="parameters" element="tns:RunCommandMobileCompress"/>
</wsdl:message>
<wsdl:message name="ICommands_RunCommandMobileCompress_OutputMessage">
<wsdl:part name="parameters" element="tns:RunCommandMobileCompressResponse"/>
</wsdl:message>
<wsdl:portType name="ICommands">
<wsdl:operation name="RunCommand">
<wsdl:input wsaw:Action="http://tempuri.org/ICommands/RunCommand" message="tns:ICommands_RunCommand_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ICommands/RunCommandResponse" message="tns:ICommands_RunCommand_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="RunCommandCompress">
<wsdl:input wsaw:Action="http://tempuri.org/ICommands/RunCommandCompress" message="tns:ICommands_RunCommandCompress_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ICommands/RunCommandCompressResponse" message="tns:ICommands_RunCommandCompress_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="RunCommandMobile">
<wsdl:input wsaw:Action="http://tempuri.org/ICommands/RunCommandMobile" message="tns:ICommands_RunCommandMobile_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ICommands/RunCommandMobileResponse" message="tns:ICommands_RunCommandMobile_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="RunCommandMobileCompress">
<wsdl:input wsaw:Action="http://tempuri.org/ICommands/RunCommandMobileCompress" message="tns:ICommands_RunCommandMobileCompress_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ICommands/RunCommandMobileCompressResponse" message="tns:ICommands_RunCommandMobileCompress_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NetTcpBinding_ICommands" type="tns:ICommands">
<wsp:PolicyReference URI="#NetTcpBinding_ICommands_policy"/>
<soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
<wsdl:operation name="RunCommand">
<soap12:operation soapAction="http://tempuri.org/ICommands/RunCommand" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandCompress">
<soap12:operation soapAction="http://tempuri.org/ICommands/RunCommandCompress" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandMobile">
<soap12:operation soapAction="http://tempuri.org/ICommands/RunCommandMobile" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandMobileCompress">
<soap12:operation soapAction="http://tempuri.org/ICommands/RunCommandMobileCompress" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="BasicHttpBinding_ICommands" type="tns:ICommands">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="RunCommand">
<soap:operation soapAction="http://tempuri.org/ICommands/RunCommand" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandCompress">
<soap:operation soapAction="http://tempuri.org/ICommands/RunCommandCompress" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandMobile">
<soap:operation soapAction="http://tempuri.org/ICommands/RunCommandMobile" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunCommandMobileCompress">
<soap:operation soapAction="http://tempuri.org/ICommands/RunCommandMobileCompress" style="document"/> 
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>

Question:

Using KSoap2-Android: How would I call RunCommandMobile using the webservice?
At the moment I have the following and it can’t be right:

private static final String METHOD_NAME = "RunCommandMobile";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String SOAP_ACTION = "http://tempuri.org/ICommands/RunCommandMobile";
private static final String URL = "http://bcgdev4.bcg.local:12970/?wsdl=wsdl0";
private static final int SOAP_VERSION = SoapEnvelope.VER11;

and here is the code snippet for calling the method:

private void hello(String message)
{
    try
    {
        //SoapObject request = new SoapObject(NAMESPACE, "Hello");
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        request.addProperty("message", message);

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

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

        //androidHttpTransport.call("http://tempuri.org/IService1/Hello",envelope);
        androidHttpTransport.call(SOAP_ACTION,envelope);
        Object result = (Object)envelope.getResponse();

        String resultData = result.toString();
        soapMessage.setText(resultData);
    } 
    catch (IOException e)
    {
        soapMessage.setText(e.toString());
        e.printStackTrace();
    } 
    catch (XmlPullParserException e)
    {
        soapMessage.setText(e.toString());
        e.printStackTrace();
    }
}

I’ve set it up as a button click in my Activity – that sets the soapMessage TextView.
I just get an Exception END_DOCUMENT - XMLPullParserExceptiona and since KSOAP2-Android is a jar, I have no way of “seeing” of seeing the actual XML.

  • 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-11T22:59:28+00:00Added an answer on June 11, 2026 at 10:59 pm

    Figured out the source of my problem:
    Everything was correct except this line –

    private static final String URL = "http://bcgdev4.bcg.local:12970/?wsdl=wsdl0";
    

    This needs to be:

     private static final String URL = "http://bcgdev4.bcg.local:13970/mobile";
    

    Because it needs to point to the URL that is expecting the soap Envelope and not the WSDL file url.

    I’m sorry if this information is not of use to anyone else, since its a very specific case, but it did solve the problem I was having. Thanks for the help.

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

Sidebar

Related Questions

I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I have followed this tutorial ( http://stuffthathappens.com/blog/2008/11/13/android-animation-101/ ) and have a beautiful rotating text
I have followed this tutorial to create a seek bar on a transparent background.
I have followed an online tut to get a full-size background using an inline
I have followed the tutorial below to use CAGradientLayer to make gradient background in
website: http://www.telugumovieshub.com/ I followed this tutorial here (except for creating a child theme): http://50dollarblogs.net/wordpress-menus-support/
I wanted a sticky footer to I followed this guide: http://www.cssstickyfooter.com/using-sticky-footer-code.html I have in
went through the tutorial http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/ and tried the same to make a fixed top
i have followed GridView in my ASP.Net Page: http://s2.imgimg.de/uploads/14b706b38JPG.jpg It should look like this:
I have followed a gallery tutorial and have it working fine, but the problem

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.