题
朋友们,
我看不到ksoap库中的请求超时
有人指导我该怎么办?还是从哪里下载它的最新版本?
我的代码
SoapObject userRequest=new SoapObject(NAMESPACE, METHOD_NAME);
userRequest.addProperty("session_id", session_id );
userRequest.addProperty("page_size", PageSize);
userRequest.addProperty("offset",Offset );
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("GetAlertsInput", userRequest);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
HttpTransportAndroid androidHttpTransport = new
HttpTransportAndroid(URL);
androidHttpTransport.call(SOAP_ACTION_GETALERTS, envelope);
任何帮助,将不胜感激。
解决方案
可以提到,我对KSOAP2 v2.5.2进行了修改,以支持HTTPTRANSPORTSE类的超时。超时会在超时时抛出Sockettimeoutexception。
在此URL上发现了罐子和SRC https://www.lightsoftai.com/?p=707
其他提示
我在服务器上有多种方法。我正在使用同一行
androidHttpTransport.call(SOAP_ACTION_GETALERTS, envelope);
使用不同的方法名称,同时第二次响应崩溃。
步骤:1获取ksoap2-android-emembly-3.3.0-jar-with-with intedencies.jar文件。并将JAR文件放入App> libs文件夹中。
步骤:2个编译文件('libs/ksoap2-android-emembly-3.3.0-jar-with-with-with-with依赖性.jar')将行放置在构建gradle>依赖项中。
步骤:3 static int NetworkTimeOut = 60 * 1000;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(inserttransaction_request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL, networkTimeOut);
不隶属于 StackOverflow