2
private String METHOD_NAME = "schedule";
private String NAMESPACE = "http://calculate.backend.web.org";
private String SOAP_ACTION = NAMESPACE + METHOD_NAME;
private static final String URL = "http://192.168.0.4:8080/AndroidBackEnd/services/Calculate?wsdl";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("username",username);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION,envelope);
Object result = envelope.getResponse();
如何验证WEB-SERVICE是否已启动并从客户端运行?检查KSOAP2网络服务是否已启动并运行
'HttpTransportSE androidHttpTransport =新HttpTransportSE(URL,timeoutDuration);'这种说法是不支持 –
它说删除timeoutduration匹配HttpTransportSE ...默认的超时时间太棠 –
快速更新..'timeout'设施我们支持只有从'Ksoap2库2.5.2''开始 –