HttpTransportSE .call () Methode hat keine Aktion

Ich versuche, eine Android-App zu erstellen, die das Wetter anhand der von Ihnen eingegebenen Postleitzahl ermittelt und die Uhrzeit auch im EST- und GMT-Format anzeigt. Ich verwende Webservices (WSDLs) und habe den Code geschrieben, um darauf zuzugreifen. Der Code ist unten:

public void sendMessage(View view)
{
    SOAP_ACTION = "http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP";
    NAMESPACE = "http://ws.cdyne.com/WeatherWS/";
    METHOD_NAME = "GetCityWeatherByZIP";
    URL = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl";

    txtZIP = (EditText) findViewById(R.id.zipcode);
    temp = (TextView) findViewById(R.id.displayTemp);
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

    PropertyInfo property = new PropertyInfo();
    {
        property.name = "zipcode";
        property.setNamespace(NAMESPACE);
        property.type = PropertyInfo.STRING_CLASS;
        property.setValue(txtZIP.getText().toString());
    }

    request.addProperty(property);

    //request.addProperty("zipcode", txtZIP.getText().toString());

    Toast.makeText(getApplicationContext(), "btnZIP pressed", Toast.LENGTH_LONG).show();
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
    envelope.setOutputSoapObject(request);
    envelope.implicitTypes = true;
    envelope.dotNet = true;
    HttpTransportSE androidHTTP = new HttpTransportSE(URL, 600);

    try {
        Toast.makeText(getApplicationContext(), "In try statement", Toast.LENGTH_LONG).show();

        androidHTTP.call(SOAP_ACTION, envelope);

        // SoapPrimitive resp = (SoapPrimitive) envelope.getResponse();
        SoapObject result = (SoapObject) envelope.bodyIn;

        if(result != null)
        {
            Toast.makeText(getApplicationContext(), "In IF statement", Toast.LENGTH_LONG).show();
            //temp.append("in IF statement, result not null");
        } else {
            Toast.makeText(getApplicationContext(), "In ELSE statement", Toast.LENGTH_LONG).show();
            //temp.append("in IF statement, result IS null");
        }

    } catch (HttpResponseException e) {
        Toast.makeText(getApplicationContext(), "No Response", Toast.LENGTH_LONG).show();
        e.printStackTrace();
    } catch (XmlPullParserException e){
        Toast.makeText(getApplicationContext(), "XML Pull exe", Toast.LENGTH_LONG).show();
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Now, mein Problem ist das mit demandroidHTTP.call(SOAP_ACTION, envelope); Methode, passiert nichts. Ich habe Toast-Methoden, um zu zeigen, was ausgeführt wird. Am weitesten komme ich in den try-Block, aber niemals in die if-Anweisung.

Ich habe versucht, mich umzusehen, um herauszufinden, was die Ursache und eine Lösung sein könnte, aber ich kann anscheinend nichts für dieses spezielle Problem finden. Ich habe das Timeout für den Server auf 600 verlängert und sogar implicitType auf true gesetzt, aber es funktioniert nichts. Ich weiß, dass ich SoapEnvelope.VER10 für diese Methode verwende, aber ich habe zwei andere Methoden, bei denen ich VER11 und VER12 verwendet habe, und es gibt keine Änderung. Wenn jemand eine Idee haben könnte, was los sein könnte, würde ich die Hilfe wirklich schätzen. Außerdem verfügt die Datei "AndroidManifest.xml" über die erforderliche Nutzungsberechtigungszeile für den Zugriff auf das Internet.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage