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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:28:45+00:00 2026-06-11T00:28:45+00:00

I’m working on a project to connect an Android powered device to a .NET

  • 0

I’m working on a project to connect an Android powered device to a .NET wcf server.

The problem I’m having is with the layout of the SOAP envelope.
When I’m using soapUI to send a request, the request is handled properly.
However, when I use Ksoap2 for Android I get a null value in return within a SOAP return envelope, the server logs there has been a request with HTTP code =200(OK).

How can I setup KSOAP2 that it creates the same SOAP envelope as is used in soapUI?

Here is a working request using soapUI. This is how the layout should look.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
    <tem:GetPerson>
      <tem:name>Roel</tem:name>
    </tem:GetPerson>
  </soapenv:Body>
</soapenv:Envelope>

And return with soapUI

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
  <GetPersonResponse xmlns="http://tempuri.org/">
     <GetPersonResult xmlns:a="http://schemas.datacontract.org/2004/07/StageService1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:Age>21</a:Age>
        <a:Name>Roel</a:Name>
     </GetPersonResult>
  </GetPersonResponse>
 </s:Body>
</s:Envelope>

I have made a Dump of the soap envelope. This is how the layout looks now when I send it from the Android application.

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema"  xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"  xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">

<v:Header />
<v:Body>
    <GetPerson xmlns="http://tempuri.org/" id="o0" c:root="1">
        <n0:name i:type="d:string" xmlns:n0="tem">Roel</n0:name>
    </GetPerson>
</v:Body>
</v:Envelope>

And the return envelope of this request

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
    <GetPersonResponse xmlns="http://tempuri.org/">
        <GetPersonResult i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/StageService1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
    </GetPersonResponse>
</s:Body>
</s:Envelope>

Could anyone explain how I get the output layout to be the same as the one I send from soapUI?

My code from the complete application:

private static final String SOAP_ACTION = "http://tempuri.org/IService1/GetPerson";
private static final String METHOD_NAME = "GetPerson";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL =      "http://192.168.4.231/TestWebservice/Service1.svc?wsdl";

try {

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    Log.e("debug","Creating new soap object");

    PropertyInfo pi = new PropertyInfo();
    pi.setNamespace("tem");
    pi.setName("name");
    pi.setValue("Roel");
    request.addProperty(pi);

    SoapSerializationEnvelope envelope = new  SoapSerializationEnvelope(SoapEnvelope.VER11);
    Log.e("debug","Creating new soap envelope");
    envelope.dotNet=true;

    envelope.setOutputSoapObject(request);
    Log.e("debug","setoutput soap object");

    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("192.168.13.8", 8080));

    HttpTransportSE androidHttpTransport = new HttpTransportSE(proxy, URL);
    Log.e("debug","new http transport init");

    androidHttpTransport.debug = true;

    androidHttpTransport.call(SOAP_ACTION, envelope);
    Log.e("debug","http transport call");
    System.out.println(androidHttpTransport.requestDump);
    System.out.println(androidHttpTransport.responseDump);

    SoapObject result = (SoapObject)envelope.getResponse();
    Log.e("debug","get response");

    tv.setText( ""+result);

} catch (Exception e) {
    tv.setText(e.getMessage());
    Log.e("error","somthing went wrong!!");
    e.toString();
    System.out.println(e);
}

Thanks in advance,

Fabian

  • 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-11T00:28:47+00:00Added an answer on June 11, 2026 at 12:28 am
    PropertyInfo pi = new PropertyInfo();
    pi.setNamespace("tem");
    pi.setName("name");
    pi.setValue("Roel");
    request.addProperty(pi);
    

    The Namespace should be the URL of the Namespace, not the variable. So:

    pi.setNamespace("http://tempuri.org/");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to show the soap response to UIWebview.. my soap response is, <p><img
I am currently running into a problem where an element is coming back from
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.