I still don't have an answer to this, but I got more info from the other side. Here is the code that processes the incoming XML and returns the various error messages:
private String processRequest( HttpServletRequest request, HttpServletResponse response) throws Exception {
String result = "";
if ( !request.isSecure() )
return "<incidents><https>Not Secure</https></incidents>";
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if ( isMultipart ){
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload();
try{
// Parse the request
FileItemIterator iter = upload.getItemIterator(request);
while (iter.hasNext()) {
FileItemStream item = iter.next();
//String name = item.getFieldName();
InputStream stream = item.openStream();
String xml_data = Streams.asString(stream);
if (item.isFormField()) {
try{
result = processXML( "form_field.xml", xml_data );
}catch(Exception e){
result = "<incidents>\n";
result += "\t<upload_result>Fail</upload_result>\n";
result += "\t<upload_error>1.Unknown error occurred: " + e.getMessage() + "</upload_error>\n";
result += "</incidents>";
}
} else {
try{
result = processXML( item.getName(), xml_data );
} catch(Exception e){
result = "<incidents>\n";
result += "\t<upload_result>Fail</upload_result>\n";
result += "\t<upload_error>2.Unknown error occurred: " + e.getMessage() + "</upload_error>\n";
result += "</incidents>";
}
}
}
} catch(Exception e){
result = "<incidents>\n";
result += "\t<upload_result>Fail</upload_result>\n";
result += "\t<upload_error>3.Unknown error occurred: " + e.getMessage() + "</upload_error>\n";
result += "</incidents>";
}
}
else{
try{
String xml_data = Streams.asString(request.getInputStream());
result = processXML( "input_stream.xml", xml_data );
} catch(Exception e){
result = "<incidents>\n";
result += "\t<upload_result>Fail</upload_result>\n";
result += "\t<upload_error>4.Unknown error occurred: " + e.getMessage() + "</upload_error>\n";
result += "</incidents>";
}
}
return result;
}
Perhaps this might help figure it out?
-- John