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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:54:48+00:00 2026-06-13T03:54:48+00:00

I have done a simple project to call wcf web service using ksoap2. But

  • 0

I have done a simple project to call wcf web service using ksoap2. But when it calls envelope.getResponse(); it gives error saying

Error:
SoapFault – faultcode: ‘a:InternalServiceFault’ faultstring: ‘The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.’ faultactor: ‘null’ detail: null

package testing.wcf;
import java.io.IOException;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;

import android.os.Bundle;
import android.os.StrictMode;
import android.widget.TextView;
import android.annotation.SuppressLint;
import android.app.Activity;

public class MainActivity extends Activity 
{
    private static final String strNAMESPACE = "http://www.testing.co.in/TestingService/";
    private static final String strURL = "http://www.testing.co.in/TestingService/UserDetails.svc";
    private static final String strSOAP_ACTION = "http://testing.co.in/TestingService/UserDetails/LoginDetails";
    private static final String strMETHOD_NAME = "LoginDetails";
    TextView tv;
    StringBuilder sb;
    String strInputXML;

      @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv = (TextView)findViewById(R.id.testing);
        sb = new StringBuilder();       
            Call();
        tv.setText(sb.toString());
        //setContentView(tv);

    }
    public void Call()
    {
         try 
         {
             SoapObject request = new SoapObject(strNAMESPACE, strMETHOD_NAME);

            String inputxml = "<?xml version="+"\""+"1.0"+"\""+" encoding="+"\""+"utf-8"+"\""+" ?>" +"<MOB> \n  <PIN>0000</PIN> \n  <LOGINID>TEST</LOGINID> \n  <PNUMBER>112233</pNUMBER> \n  <REQUESTID>LoginVal</REQUESTID> \n </MOB>";

            request.addAttribute("strInputXML", inputxml);
            request.addAttribute("strOutputXML","");

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

             HttpTransportSE androidHttpTransport = new HttpTransportSE(strURL);
             androidHttpTransport.call(strSOAP_ACTION, envelope);
             SoapPrimitive result = (SoapPrimitive)envelope.getResponse();

             String resultData = result.toString();
             sb.append(resultData + "\n");
         }
         catch(Exception e)
         {
             sb.append("Error:\n" + e.getMessage() + "\n");
         }       
    }
}

Here I want to send the request like this

<?xml version="1.0" encoding="utf-8" ?> 
<PhoneData>
<PINNO>0000</PINNO>
<LOGINID>HELLO</LOGINID>
<PASSWORD>1234</PASSWORD>
<REQID>0</REQID>
</PhoneData>

My respond XML should be

<?xml version="1.0" encoding="utf-8" ?> 
<PhoneData>
<OTA>1234</OTA>
</PhoneData>
  • 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-13T03:54:50+00:00Added an answer on June 13, 2026 at 3:54 am

    I post my working code for consuming a WCF (binding of WCF has to be basicHttpBinding!):

    private static final String NAMESPACE = "http://tempuri.org/";
    private static String URL="your url";
    
    private static final String SOAP_ACTION_VALIDATION = "IValidateUser_wcf/ValidateUser";
    private static final String VALIDATION_METHOD = "ValidateUser";
    
    public boolean validateUser_WCF(String username, String password){
    
        SoapSerializationEnvelope envelope = null;
        SoapObject request = null;
        HttpTransportSE httpTransportSE = null;
    
        try {
            request = new SoapObject(NAMESPACE, VALIDATION_METHOD);
            request.addProperty("username", username);
            request.addProperty("password", password);
    
            envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.dotNet = true; 
            envelope.setOutputSoapObject(request);
    
                //////////////////////////////                               
                // here you can add a HEADER element if you want
            Element[] header = new Element[1];  
    
            header[0] = new Element().createElement(NAMESPACE_INFOCAD, "a1");                
            header[0].addChild(Node.TEXT, "HeaderTextContent");
    
            envelope.headerOut = header;
                //////////////////////////////                               
    
            httpTransportSE = new HttpTransportSE(URL+VALIDATION_URI, 10*10000); // second parameter is timeout
            httpTransportSE.debug = true;
            httpTransportSE.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            httpTransportSE.call(NAMESPACE+SOAP_ACTION_VALIDATION, envelope);
    
                // if response is a simple text result, you can call SoapPrimitive, if not, you have to call SoapObject result and navigate in response's tree like an xml file
            SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
    
            //To get the data.
            String textResult = result.toString();
            Log.i("textResult", textResult); 
    
                        return true;
    
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }finally{
                     // here you can see in LOG what is request you send and what is response received
                    Log.i(getClass().getSimpleName(),"requestDump : "+httpTransportSE.requestDump);
                    Log.i(getClass().getSimpleName(),"responseDump : "+httpTransportSE.responseDump);
        }
    
        return false;
    }
    

    Hope my code can help you :). It works at 100%

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

Sidebar

Related Questions

I've done some simple string -> DateTime conversions before using DateTime.ParseExact(), but I have
I want to do a simple drag-drop using jQuery. I have not done anything
I have created a simple web service called TimeServerBean . It's working properly, the
I have done simple java app for blackberry, while building am getting following error.
I have done a simple code for a slideshow that dynamicly loads images from
I have recently done a very simple highlighting with jQuery and a highlight plugin.
I hope I am not missing something very simple here. I have done a
I'm looking for a simple way to have this done. I would to have
Say you have a simple loop while read line do printf ${line#*//}\n done <
I have a very simple ajax request: $.get(url, data) .done(function () { }) .fail(function

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.