Something is wrong with importing org.ksoap2.transport.AndroidHttpTransport;

I want to run an existing project.but when I imported ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar an error occurred.

 import org.ksoap2.transport.AndroidHttpTransport; 

I can not find the AndroidHttpTransport method in the org.ksoap2.transport package. how can i handle this?

+4
source share
4 answers

AndroidHttpTransport is deprecated ... for more information about this change, see this link: http://code.google.com/p/wsdl2ksoap/issues/detail?id=2

You will see that there is also a solution to correct the code if it already exists in your project with this replacement:

 AndroidHttpTransport ht = new AndroidHttpTransport(Address); androidHttpTransport.call(params.GetSoapAction(), envelope); 

in

 HttpTransportSE ht = new HttpTransportSE(Address); ht.call(params.GetSoapAction(), envelope); 
+1
source

You should use the ksoap2 jar file. And then use the following code

 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS); SoapObject response=null; try { httpTransport.call(SOAP_ACTION, envelope); response = (SoapObject) envelope.bodyIn; 
+1
source

You need to import ksoap2-android-assembly-2.4-jar-with-dependencies.jar. Then the error will be deleted.

0
source

copy the jar file (ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar) to the lib folder and then update the lib folder from eclipse

0
source

Source: https://habr.com/ru/post/1438418/


All Articles