2013-10-09 40 views
1

當我用String []一個在SoapSerializationEnvelope添加屬性,則返回錯誤ksoap2設置的String []以request.addProperty

SoapObject request = new SoapObject(NAMESPACE, METHOD_SendArray);  

       //Use this to add parameters 
       String[] a ={"21","22","23","66"}; 
       long[] x= new long[] { }; 
       request.addProperty("NumberList",a); 
       request.addProperty("ID",x); 

       //Declare the version of the SOAP request 
       SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 

       envelope.setOutputSoapObject(request); 
       envelope.dotNet = true; 

request body : 

SendArray{NumberList=[Ljava.lang.String;@4052fa20; ID=[[email protected]; } 

Error : 

java.lang.RuntimeException: Cannot serialize: [Ljava.lang.String;@4052fa20 

回答

1

類型String[]不KSOAP的期限序列化圖書館。有關發送數據數組的信息,請參閱this link