我想将SOAP Web服务发送的JSON字符串中的数据转换为Android应用程序中的JSON对象。我写的代码适用于服务器发送的小JSON字符串。 问题是当服务器发送一个大字符串时,结果字符串会被删除。我感谢任何建议或解决方案。 这是代码:
@Override
protected String doInBackground(SoapRequestHelper... params) {
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(params[0].getRequest());
HttpTransportSE httpTransportSE = new HttpTransportSE(params[0].getUrl());
try {
httpTransportSE.call(params[0].getSoapAction(), soapEnvelope);
String result = soapEnvelope.bodyIn.toString();
return result;
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
return null;
}