我需要将一个字符串数组传递给一个预定义的网络服务,该网络服务旨在接受一个字符串值数组。但是,当我创建一个肥皂信封并将array.class或string.class属性设置为请求时,它会引发一个序列化错误。
对上述有什么建议吗?建议的数据类型或方法应该是什么?
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
PropertyInfo p1 = new PropertyInfo();
p1.setName("items");
p1.setValue(results);
p1.setType(String.class); // else Array.class.
request.addProperty(p1);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
httpTransport.debug = true;
httpTransport.call(SOAP_ACTION, envelope);
// throws an error in the above.
result = httpTransport.responseDump;