0

Possible Duplicate:
How to call SOAP web service with Android

I am using this code but it is giving some error like: Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.rossitek.Welcome.onCreate

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
        request.addProperty("fname","kum");// Parameter for Method
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet = true;// **If your webservice in .net otherwise remove it**
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {
        androidHttpTransport.call(SOAP_ACTION, envelope);//call the eb service Method
        } catch (Exception e) {
        e.printStackTrace();}//Next task is to get Response and format that response
        SoapObject obj = null,obj1,obj2,obj3;
        try {
            obj = (SoapObject) envelope.getResponse();
        } catch (SoapFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        obj1=(SoapObject) obj.getProperty("diffgram");
        obj2=(SoapObject) obj1.getProperty("NewDataSet");
        for(int i=0;i<obj2.getPropertyCount();i++)//the method getPropertyCount() return the number of rows
        {
        obj3=(SoapObject) obj2.getProperty(i);  
        obj3.getProperty(0).toString();//value of column 1
        obj3.getProperty(1).toString();//value of column 2
        //like that you will get value from each column
        }
Community
  • 1
  • 1
Kumar
  • 388
  • 1
  • 8
  • 18
  • There are many same question asked here, one of them is given below [calling soap from Android app](http://stackoverflow.com/questions/297586/how-to-call-soap-web-service-with-android) – AAnkit Jun 06 '12 at 11:52

1 Answers1

1

I think. In run time application do not found any SoapObject class in ksoap2 jar file.

download last update ksoap2 jar file and try.

I think it help you.

Md Abdul Gafur
  • 6,120
  • 2
  • 25
  • 37