4

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?

Dan F
  • 17,654
  • 5
  • 72
  • 110
Sunny
  • 101
  • 1
  • 5

4 Answers4

1

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);
whyoz
  • 5,168
  • 47
  • 53
1

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;
Raj
  • 61
  • 5
0

You have to import ksoap2-android-assembly-2.4-jar-with-dependencies.jar. Then the error will remove.

Arup
  • 1
  • 1
0

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

jamil
  • 352
  • 1
  • 3
  • 12