I am getting error of unterminatned entity ref. only with oreo version.it's working perfectly on other versions.i am using ksoap2 3.1.1 version.and also this error is not coming every time.sometimes it's working perfectly.and i noticed one thing that if my json response is too large i get this exception.please any one can help me? i get exception at httpTransport.call(SOAP_ACTION, envelope); This is my code.
@Override
protected String doInBackground(Void... params) {
try {
Log.d("response","5");
SOAP_ACTION = getString(R.string.WSDL_TARGET_NAMESPACE)+OPERTATION_NAME;
Log.d("response",SOAP_ACTION);
SoapObject request = new SoapObject(getString(R.string.WSDL_TARGET_NAMESPACE),OPERTATION_NAME);
Log.d("response",OPERTATION_NAME);
Log.d("response",getString(R.string.WSDL_TARGET_NAMESPACE));
String user = sharedpreference.getvalue("user",Dashboard_Distributer.this);
ArrayList<param> pi=new ArrayList<>();
pi.add(new param("utype", "Distributer"));
for(int i=0;i<pi.size();i++) {
request.addProperty(pi.get(i).getName(), pi.get(i).getValue());
}
Log.d("response",request.toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(getString(R.string.SOAP_ADDRESS),6000000);
Log.d("response",getString(R.string.SOAP_ADDRESS));
Object response=null;
try {
Log.d("response","6");
// httpTransport.setTimeout(9000);
httpTransport.call(SOAP_ACTION, envelope);
response = envelope.getResponse();
} catch (Exception exception) {
exception.printStackTrace();
Log.d("response","7");
response=exception.toString();
}
Log.d("response","8");
return response.toString();
} catch (Exception e) {
e.printStackTrace();
Log.d("response","9");
resp = e.getMessage();
}
return resp;
}
@Override
protected void onPostExecute(String result) {
// execution of result of Long time consuming operation
String response=result;
try {
JSONObject jsonObj = new JSONObject(response);
JSONArray jsonArray = jsonObj.getJSONArray("data");
article_models=new ArrayList<>();
for(int i=0;i<jsonArray.length();i++)
{
JSONObject jsonObject = jsonArray.getJSONObject(i);
Article_Model article_model = new Article_Model(jsonObject.getString("ItemCode"), jsonObject.getString("U_Mould"), jsonObject.getString("U_Color"),
jsonObject.getString("ColorName"), jsonObject.getString("U_MRP"), jsonObject.getString("U_Category"), jsonObject.getString("U_Image"),jsonObject.getString("type"));
article_models.add(article_model);
}
manageDatabase.deleteArticle();
manageDatabase.addArticles(article_models);
retailer_models=new ArrayList<>();
ArrayList<param> pi2 = new ArrayList<>();
pi2.add(new param("distributor_id", sharedpreference.getvalue("user_id", getApplicationContext())));
CallSoap callSoap2 = new CallSoap(Dashboard_Distributer.this, pi2, OPERTATION_NAME2, true);
String response2 = callSoap2.Call();
Log.d("response", response2);
JSONObject jsonObj2 = new JSONObject(response2);
JSONArray jsonArray2 = jsonObj2.getJSONArray("data");
for (int i = 0; i < jsonArray2.length(); i++) {
JSONObject jsonObject = jsonArray2.getJSONObject(i);
Retailer_Model distributor_model = new Retailer_Model(jsonObject.getString("retailer_id"), jsonObject.getString("retailer_name"),jsonObject.getString("distributer_id"));
retailer_models.add(distributor_model);
}
manageDatabase.deleteRetailer();
manageDatabase.addRetailars(retailer_models);
} catch (JSONException e) {
e.printStackTrace();
}
progressDialog.dismiss();
// finalResult.setText(result);
}
}