Visualizzazione dei risultati da 1 a 10 su 19

Visualizzazione discussione

  1. #3
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Grazie per i preziosi ed utili consigli.


    1. ho rinominato la classe java da callws in CallWs;
    2. ho fatto debug con questo codice semplificato, in cui provo a passare solo un parametro al web service, ma l'app continua ad andare in crash...


    codice:
        @Override    public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.ws);
    
    
            SoapObject Request = new SoapObject(WSDL_TARGET_NAMESPACE,
                    OPERATION_NAME);
    
    
            Request.addProperty("fname", "Peppino");
    
    
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                    SoapEnvelope.VER11);
            envelope.dotNet = true;
            envelope.setOutputSoapObject(Request);
    
    
            HttpTransportSE httptransport = new HttpTransportSE(SOAP_ADDRESS);
    
    
            TextView textView = new TextView(this);
            setContentView(textView);
    
    
            try {
                httptransport.call(SOAP_ACTION, envelope);
                SoapObject response = (SoapObject) envelope.getResponse();
                String val = response.getProperty(0).toString();
                Log.d("CallWs.class", "Valore restituito: " + val);
                int result = Integer.parseInt(val);
                Log.d("CallWs.class", "Valore parsato: " + result);
    
    
            } catch (SocketException ex) {
                ex.printStackTrace();
                Log.e("Error", ex.getMessage());
            } catch (Exception e) {
                e.printStackTrace();
                Log.e("Error", e.getMessage());
            }
    Log cat di eclipse:
    03-03 18:14:13.741: E/SpannableStringBuilder(12971): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

    03-03 18:14:13.741: E/SpannableStringBuilder(12971): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length


    03-03 18:14:23.871: E/AndroidRuntime(12971): FATAL EXCEPTION: main


    03-03 18:14:23.871: E/AndroidRuntime(12971): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxxx.xxxxx/com.xxxxx.xxxxx.CallWs}: java.lang.NullPointerException: println needs a message


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2110)


    03-03 18:14:23.871: E/Andr
    oidRuntime(12971): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2135)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.ActivityThread.access$700(ActivityThre ad.java:140)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1237)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.os.Handler.dispatchMess
    age(Handler.java:99)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.os.Looper.loop(Looper.java:137)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.ActivityThread.main(ActivityThread.jav a:4935)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at java.lang.reflect.Method.invokeNative(Native Method)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at java.lang.reflect.Method.invoke(Method.java:511)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:1038)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:805)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at dalvik.system.NativeStart.main(Native Method)


    03-03 18:14:23.871: E/AndroidRuntime(12971): Caused by: java.lang.NullPointerException: println needs a message


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.util.Log.println_native(Native Method)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.util.Log.e(Log.java:297)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at com.xxxxx.xxxxx.CallWs.onCreate(CallWs.java:61)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.Activity.performCreate(Activity.java:5 206)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1094)


    03-03 18:14:23.871: E/AndroidRuntime(12971): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2074)


    03-03 18:14:23.871: E/AndroidRuntime(12971): ... 11 more
    Ultima modifica di wegawhite; 03-03-2014 a 19:21

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.