【发布时间】:2014-07-29 11:52:22
【问题描述】:
我有以下问题: 我开发了一个通过 ksoap 访问 Web 服务的应用程序。 但是,此连接仅适用于移动网络 (3G/Edge)。 当手机通过wifi或移动热点连接时,他没有加载我的错误就把我扔了出去。
代码如下:
//Variablen
static String NAMESPACE = "http://tempuri.org/";
static String URL = "http://wgo.*******************";
static String METHOD_NAME;
static String SOAP_ACTION;
public static String getLogins(String pubkey, String user, String ip, String password, String timeOfRequest, String timeOfLastRequest, String lastXML) throws IOException, XmlPullParserException
{
METHOD_NAME = "GetLogins";
SOAP_ACTION = "http://tempuri.org/GetLogins";
//Request
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("pubkey", pubkey);
request.addProperty("user", user);
request.addProperty("ip", ip);
request.addProperty("password", password);
request.addProperty("timeOfRequest", timeOfRequest);
request.addProperty("timeOfLastRequest", timeOfLastRequest);
request.addProperty("lastXML", lastXML);
//Envelope
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(request);
//Fehler auschließen
System.setProperty("http.keepAlive", "false");
//Ausführen
HttpTransportSE http = new HttpTransportSE(URL,60000);
http.call(SOAP_ACTION, soapEnvelope, null);
//Ergebnis
SoapPrimitive response = (SoapPrimitive) soapEnvelope.getResponse();
String ergebnis = response.toString();
return ergebnis;
}
我已经尝试了一切......我真的很绝望......我希望你还有一个小费给我。 我使用了 ksoap 3.3,也尝试了不同版本的不同 Android 设备
亲切的问候
【问题讨论】: