// 发送端代码 int[] intArray = {1, 2, 3}; Integer[] integerArray = new Integer[intArray.length]; for (int i = 0; i < intArray.length; i++) { integerArray[i] = Integer.valueOf(intArray[i]); } SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo propertyInfo = new PropertyInfo(); propertyInfo.setName("intArray"); propertyInfo.setValue(integerArray); propertyInfo.setType(new Integer[0].getClass()); request.addProperty(propertyInfo); // ...
// 接收端代码 SoapObject response = (SoapObject) envelope.getResponse(); Object propertyValue = response.getProperty("intArray"); if (propertyValue instanceof PropertyInfo[]) { Integer[] integerArray = (Integer[]) ((PropertyInfo[]) propertyValue)[0].getValue(); int[] intArray = new int[integerArray.length]; for (int i = 0; i < integerArray.length; i++) { intArray[i] = integerArray[i].intValue(); } // use intArray ... } // ...
// 发送端代码 int[] intArray = {1, 2, 3}; StringBuilder sb = new StringBuilder(); for (int i = 0; i < intArray.length; i++) { sb.append(intArray[i]); if (i != intArray.length - 1) { sb.append(","); } } SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo propertyInfo = new PropertyInfo(); propertyInfo.setName("intArray"); propertyInfo.setValue(sb.toString()); propertyInfo.setType(String.class); request.addProperty(propertyInfo); // ...
// 接收端代码 SoapObject response = (SoapObject) envelope.getResponse(); Object propertyValue = response.getProperty("intArray"); if (propertyValue instanceof PropertyInfo) { String intArrayString = ((PropertyInfo) property