Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用Ksoap2时出错_Android_Ksoap2 - Fatal编程技术网

Android 使用Ksoap2时出错

Android 使用Ksoap2时出错,android,ksoap2,Android,Ksoap2,这是我的web服务。我只想获取名称。但是当我运行我的应用程序时,我得到了一个错误 java.lang.NoClassDefFoundError:org.ksoap2.serialization.soapobject位于我的包名处 public static String SOAP_ACTION1 = "http://tempuri.org/GetContact"; // private static String SOAP_ACTION2 = "http://tempuri.org/Ce

这是我的web服务。我只想获取名称。但是当我运行我的应用程序时,我得到了一个错误

java.lang.NoClassDefFoundError:org.ksoap2.serialization.soapobject位于我的包名处

public static String SOAP_ACTION1 = "http://tempuri.org/GetContact";

   // private static String SOAP_ACTION2 = "http://tempuri.org/CelsiusToFahrenheit";

public static String NAMESPACE = "http://tempuri.org/";

public static String METHOD_NAME1 = "GetContact";

//private static String METHOD_NAME2 = "CelsiusToFahrenheit";

private static String URL = "http://115.119.182.114/Rotaryclub/RotaryService.asmx"; 

TextView txt;
//ListView lv;
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setContentView(R.layout.displaycontacts);

    txt=(TextView) findViewById(R.id.textView11);





      //CALL the web service method with the two parameters vname and nname

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);

        request.addProperty( "Cid","1");
        request.addProperty("Position", "doctor");
        request.addProperty("Name", "abhishek");
        request.addProperty("ImageUrl", "test.jpg");
        request.addProperty("PhoneNo", "4324434323");
        request.addProperty("MobileNo", "4324434323");
        request.addProperty("FaxNo", "43-434-34");
        request.addProperty("EmailId", "abh22ishek@gmail.com");
        request.addProperty("Address", "kalkere");



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

        // Make the soap call.
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {

            //this is the actual part that will call the webservice
            androidHttpTransport.call(SOAP_ACTION1, envelope);        
        } catch (Exception e) {
            e.printStackTrace(); 
        }

        // Get the SoapResult from the envelope body.       
        SoapObject result = (SoapObject)envelope.bodyIn;
       // SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
       // String strRes = result.toString();


        if(result != null){

            txt.setText("SOAP response:\n\n" + result.getProperty(2).toString());
        }

请编辑您的问题并添加您使用的JAR列表。它将帮助我们找出问题所在