其他分享
首页 > 其他分享> > 导入org.ksoap2.transport.AndroidHttpTransport有问题;

导入org.ksoap2.transport.AndroidHttpTransport有问题;

作者:互联网

我想运行一个现有的项目.但是当我导入ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar时,发生了错误.

import org.ksoap2.transport.AndroidHttpTransport;

我在包org.ksoap2.transport中找不到AndroidHttpTransport方法.
我怎么处理它?

解决方法:

你应该使用kso​​ap2 jar文件..
然后使用以下代码

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;

标签:android,android-ksoap2
来源: https://codeday.me/bug/20190704/1373808.html