Reputation: 93
i want to run a existing project.but when i imported the ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar
,the error occurred.
import org.ksoap2.transport.AndroidHttpTransport;
i can't find AndroidHttpTransport
method in package org.ksoap2.transport
.
how can i deal with it?
Upvotes: 4
Views: 3008
Reputation: 5246
AndroidHttpTransport is deprecated...for more info on this change, check out this link: http://code.google.com/p/wsdl2ksoap/issues/detail?id=2
You will see that there is also a solution to fix the code if it already exists in your project by this replacement:
AndroidHttpTransport ht = new AndroidHttpTransport(Address);
androidHttpTransport.call(params.GetSoapAction(), envelope);
to:
HttpTransportSE ht = new HttpTransportSE(Address);
ht.call(params.GetSoapAction(), envelope);
Upvotes: 1
Reputation: 61
You should use ksoap2 jar file.. And then use 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;
Upvotes: 1
Reputation: 352
copy the jar file (ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar) to lib folder and then refresh lib folder from eclipse
Upvotes: 0
Reputation: 1
You have to import ksoap2-android-assembly-2.4-jar-with-dependencies.jar. Then the error will remove.
Upvotes: 0