I also had the same problem, but after some research I sort it out. You cannot post multiple images in json through a soothing web service.
To do this, you must use the xml format and click on the service.
1) First create an xml request:
public String createXMLRequestForMultiplePhoto() { StringBuffer strBuffer = null; try { strBuffer = new StringBuffer(); strBuffer.append("<?xml version='1.0' encoding='utf-8'?><UploadChallanMultiplePhoto>"); strBuffer.append("<userid>" + Constant.USER_ID + "</userid>"); strBuffer.append("<accesstoken>" + Constant.ACCESS_TOCKEN + "</accesstoken>"); strBuffer.append("<TempChallanNo>" + "0" + "</TempChallanNo>"); //ADD MULTIPLE PHOTO TAGS START strBuffer.append("<driverphotos>"); int i=0; while(i<hexStringArrayList.size()){ strBuffer.append("<driverphoto>"); strBuffer.append(hexStringArrayList.get(i)); strBuffer.append("</driverphoto>"); i++; } strBuffer.append("</driverphotos>"); //ADD MULTIPLE PHOTO TAGS ENDS strBuffer.append("</UploadChallanMultiplePhoto>"); } catch (Exception e) { } return strBuffer.toString(); }
2) Now you can use the code below to get into the web service:
public static String fetchAllActivatedRestForAddMultiplPhoto(String url) { String responseString = ""; try { int TIMEOUT_MILLISEC = 20000;
Hope this helps you.
Ricky khatri
source share