【问题标题】:Android ksoap2 connection don't work via wifi / hotspot but with 3G/EdgeAndroid ksoap2 连接无法通过 wifi / 热点但使用 3G/Edge
【发布时间】: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 设备

亲切的问候

【问题讨论】:

    标签: android ksoap


    【解决方案1】:

    我认为您从代码中调用的链接被您的 wifi 代理设置阻止了,只需使用其他 wifi 连接进行测试,如果是这种情况,它会起作用,然后确定它不是错误,它与您的代理设置相关的问题

    【讨论】:

    • 您好,感谢您的快速答复。但我测试了 4-5 个不同的 wifi 连接和一个移动热点(将我的 android 设备连接到 iphone 热点)。没有任何效果。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-09
    • 2015-12-24
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多