if (serviceData.sizeOfPartialErrors() > 0) { StringBuffer messageBuffer = new StringBuffer(); ErrorStack errorStack; String[] messages; for (int i = 0, size = serviceData.sizeOfPartialErrors(); i < size; i++) { errorStack = serviceData.getPartialError(i); messages = errorStack.getMessages(); for (int j = 0, jsize = messages.length; j < jsize; j++) { messageBuffer.append(messages[j] + "\n"); } } System.out.println(messageBuffer.toString()); }