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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:41:12+00:00 2026-06-12T20:41:12+00:00

I’m using SOAP to communicate with a Webservice written in .Net . The source

  • 0

I’m using SOAP to communicate with a Webservice written in .Net. The source code is beneath:

public class SlipperyAsSoap extends Activity {

Button sendMsg;
TextView resultText;
EditText query;

final String NAMESPACE = "http://tempuri.org/";
final String SOAP_ACTION = "http://tempuri.org/IIOService/SendMessage";
final String METHOD_NAME = "SupportedMessageTypes";
final String URL = "http://biovnap.no.netserver/Bio/IOService.svc?wsdl";

// private static String SOAP_ACTION1 =
// "http://tempuri.org/FahrenheitToCelsius";
// private static String SOAP_ACTION2 =
// "http://tempuri.org/CelsiusToFahrenheit";
// private static String NAMESPACE = "http://tempuri.org/";
// private static String METHOD_NAME1 = "FahrenheitToCelsius";
// private static String METHOD_NAME2 = "CelsiusToFahrenheit";
// private static String URL =
// "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL";

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    sendMsg = (Button) findViewById(R.id.button1);
    resultText = (TextView) findViewById(R.id.textView1);
    query = (EditText) findViewById(R.id.editText1);
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
            .permitAll().build();
    StrictMode.setThreadPolicy(policy);

    sendMsg.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {

            // Initialize soap request + add parameters
            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

            // Use this to add parameters
            // request.addProperty("Fahrenheit",
            // query.getText().toString());

            // Declare the version of the SOAP request
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                    SoapEnvelope.VER11);

            envelope.setOutputSoapObject(request);
            envelope.dotNet = true;

            try {
                HttpTransportSE androidHttpTransport = new HttpTransportSE(
                        URL);
                androidHttpTransport.debug = true;
                // this is the actual part that will call the webservice

                androidHttpTransport.call(SOAP_ACTION, envelope);

                // Get the SoapResult from the envelope body.
                SoapObject result = (SoapObject) envelope.bodyIn;

                if (result != null) {
                    // Get the first property and change the label text
                    resultText.setText(result.getProperty(0).toString());
                } else {
                    Toast.makeText(getApplicationContext(), "No Response",
                            Toast.LENGTH_LONG).show();
                }
            } catch (IOException e) {
                e.printStackTrace();
            } catch (XmlPullParserException e) {
                Log.e("XMLPullParser: ", e.getMessage());
            }
        }

    });
}
}

As you can see, I tried contacting the webservice from W3Schools, just for test purposes. And this works perfectly, but when I try to contact my webservice, which is reachable in the same network as my phone, I only got this error from LogCat:

10-11 10:11:21.435: E/XMLPullParser:(1043): unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@41a790d8) 

The method I try to reach is this one:

wsdl:operation name="SupportedMessageTypes">
<wsdl:input wsaw:Action="http://tempuri.org/IIOService/SupportedMessageTypes" message="tns:IIOService_SupportedMessageTypes_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IIOService/SupportedMessageTypesResponse" message="tns:IIOService_SupportedMessageTypes_OutputMessage"/>
</wsdl:operation>

This error occurs when I try to do a androidHttpTransport.call(SOAP_ACTION, envelope); I know that this should be put in a AsyncTask, every Network operations should be constructed that way, so please do not complain about that.

Here is the Request XML from WCF Test Client

 <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IIOService/SupportedMessageTypes</a:Action>
    <a:MessageID>urn:uuid:5c3f721a-f0d6-4be9-9699-10b48a2ee146</a:MessageID>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
  </s:Header>
  <s:Body>
    <SupportedMessageTypes xmlns="http://tempuri.org/" />
  </s:Body>
</s:Envelope>

And response XML

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IIOService/SupportedMessageTypesResponse</a:Action>
    <a:RelatesTo>urn:uuid:85436e79-86bb-4370-843c-b1047975b864</a:RelatesTo>
  </s:Header>
  <s:Body>
    <SupportedMessageTypesResponse xmlns="http://tempuri.org/">
      <SupportedMessageTypesResult xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <b:string>EurodacTestReplyGenerator</b:string>
        <b:string>EurodacBlock</b:string>
      </SupportedMessageTypesResult>
    </SupportedMessageTypesResponse>
  </s:Body>
</s:Envelope>

Can anybody give me a hint on this error message?

Thanks in advance!

  • 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-12T20:41:13+00:00Added an answer on June 12, 2026 at 8:41 pm

    SOAP_ACTION is NAMESPACE + METHOD

    So, that is where I think you are going wrong in calling your own service.

    Assuming that you have correcting assigned the Method and the Namespace, the following should work.

    final String NAMESPACE = "http://tempuri.org/";
    final String SOAP_ACTION = "http://tempuri.org/IIOService/SupportedMessageTypes";
    final String METHOD_NAME = "SupportedMessageTypes";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want to show the soap response to UIWebview.. my soap response is, <p><img
We're building an app, our first using Rails 3, and we're having to build

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.