我正在使用ksoap2来调用多个Web服务,这是我的代码
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
Log.e("beforeCall","before");
androidHttpTransport.call(SOAP_ACTION, envelope);
Log.e("afterCall","before");
if (envelope.bodyIn instanceof SoapFault) {
String str= ((SoapFault) envelope.bodyIn).faultstring;
Element detailElem = (Element) details.getElement(0)
.getChild(0);
Element e = (Element) detailElem.getChild(2);faultstring;
} else {
SoapObject result = (SoapObject)envelope.bodyIn;
if(result != null)
{
return result.getProperty(0).toString();
}
else
{
Log.d("noResponse", "No Response");
}
}
} catch (Exception e) {
Log.e("Exception","exception");
e.printStackTrace();
}
return null;
}
我得到了另一个类的响应:
String Response = ApiCalls.NewProfile("Param1","Param1","Param1");
Toast.makeText(getApplicationContext(), Response, Toast.LENGTH_SHORT).show();
它在sdk版本8上工作正常,但我使用的是min=11
和target = 17
看到日志“BeforCall”并显示在 LogCat 中,但“ AfterCall ”不显示,响应为null
。
我的sdk版本是否有任何等效的调用声明?