我需要将一个字符串数组传递给一个预定义的 webserivce,该 webserivce 旨在接受一个字符串值数组。但是,当我创建一个 soap 信封并将 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;
最佳答案
关于android - 如何使用 soap 库将字符串数组传递给 Web 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16556963/