朋友们,
我在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);
任何帮助将不胜感激。
答案 0 :(得分:0)
我在服务器上有多个方法。我使用的是同一行
androidHttpTransport.call(SOAP_ACTION_GETALERTS, envelope);
使用不同的方法名称,同时得到第二个响应它的崩溃。
答案 1 :(得分:0)
STEP:1 获取ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar文件。并将jar文件放在app> libs文件夹中。
STEP:2 编译文件(“ libs / ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar”)将行放置在build gradle>依赖项中。
STEP:3 静态整数networkTimeOut = 60 * 1000;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(inserttransaction_request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL, networkTimeOut);
答案 2 :(得分:-1)
可以提一下,我对KSoap2 v2.5.2进行了修改,以支持HttpTransportSE类的超时。超时发生时会抛出SocketTimeoutException。
中找到了jar和src