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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:21:01+00:00 2026-05-28T04:21:01+00:00

I have an ASMX webservice setup on Microsoft Azure and I’m trying to send

  • 0

I have an ASMX webservice setup on Microsoft Azure and I’m trying to send data to the webservice and receive output using an android application. For this purpose, I am using the KSOAP library.

On the webservice, I’m checking if the strings are null. If they are, I return an error code “2405”

[WebMethod]
        public string LoginUser(string auth_token, string username)
        {
            // All these tests performed, so someone from outside of out application
            // scope does not attempt to abuse our webservice.
            #region Check for nulls
            if (string.IsNullOrEmpty(auth_token))
                return "2405";
            if (string.IsNullOrEmpty(username))
                return "2405";
            #endregion
        }

In my android application, I am sending the data, but the webservice still returns the 2405 error code, which means that the data is not sent.

The following is my android code:

        SoapObject request = new SoapObject(NAMESPACE, method_name);

        PropertyInfo pi = new PropertyInfo();
        pi.setName("auth_token");
        pi.setValue("TestAuth");
        request.addProperty(pi);

        PropertyInfo pe = new PropertyInfo();
        pe.setName("username");
        pe.setValue("TestUser");
        request.addProperty(pe);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
        envelope.dotNet = true;

        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        androidHttpTransport.call(SOAP_ACTION, envelope);

Sorry that I can provide you with the namespace, methodname, url, etc. It is against the company policy and I hope you understand. 🙂

Nevertheless, I’ll go over the error again. After calling the above Android code, the webservice returns 2405, which according to the ASMX code is when any of the twos values are null.

UPDATE: I debugged the SOAP request (androidHttpTransport.debug = true) and got the following results for the requestDump and responseDump.

Request Dump

<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>
    <LoginUser xmlns="http://tempuri.org" id="o0" c:root="1">
      <auth_token i:type="d:string">TestAuth</auth_token>
      <username i:type="d:string">TestUser</username>
    </LoginUser>
  </v:Body>
</v:Envelope>

responseDump

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <LoginUserResponse xmlns="http://tempuri.org/">
      <LoginUserResult>2405</LoginUserResult>
    </LoginUserResponse>
  </soap:Body>

</soap:Envelope>

UPDATE 2
This is what the server expects:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LoginUser xmlns="http://tempuri.org/">
      <auth_token />
      <username />
    </LoginUser>
  </soap:Body>
</soap:Envelope>

This is what the android application is sending:

<?xml version="1.0" encoding="utf-8"?>
<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>
        <LoginUser xmlns="http://tempuri.org" id="o0" c:root="1">
            <auth_token i:type="d:string">TestAuth</auth_token>
            <username i:type="d:string">TestUser</username>
        </LoginUser>
    </v:Body>
</v:Envelope>

In addition to this, I’ve added the following line to the android code:

androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");

PLEASE HELP!

Many thanks!

  • 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-05-28T04:21:02+00:00Added an answer on May 28, 2026 at 4:21 am

    I was able to clear the error…The problem was that I didn’t have a backslash after the namespace URI…The reason I didn’t is that with the backslash I got the error “Sequence contains no elements”…Now, however, I’m having different errors…If I need help I’ll post on StackOverFlow…Thanks for the generous help 🙂

    To be clear, the namespace must have a a backslash at the end, in order for the server to receive any parameters.

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

Sidebar

Related Questions

We have an ASMX web service which we invoke from our ASP.NET application using
I have a webservice that I need to POST some data to using Qt.
I have ajax request to post data to asmx webservice, how will i post
For a few days now I have been trying to get an ASMX webservice
I have just tried adding a WebService (asmx based) from a WebForms project to
I have a webservice project (old asmx technology) in which I have a class
Im trying to create an ASMX Web Service in Visual Web Developer.I have successfully
I have a .NET web service (using asmx...have not upgraded to WCF yet) that
In Visual Studio 2010 I have created a WebService (WCF) Application and a client
I have an ASMX webservice that returns XElement - (not an .svc WCF service)

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.