List<NamedString> mimeAttributes = new ArrayList<NamedString>(2);
String value = FileUpload.FORM_DATA + ";" + " name=\"" + item.getFieldName() + "\";" + " filename=\""
+ item.getName() + "\"";
NamedString mimeAttribute = WSRPTypeFactory.createNamedString(FileUpload.CONTENT_DISPOSITION, value);
mimeAttributes.add(mimeAttribute);
mimeAttribute = WSRPTypeFactory.createNamedString(FileUpload.CONTENT_TYPE, item.getContentType());
mimeAttributes.add(mimeAttribute);
uploadContext.getMimeAttributes().addAll(mimeAttributes);
uploadContexts.add(uploadContext);
} else {
NamedString formParameter = WSRPTypeFactory.createNamedString(item.getFieldName(),
Streams.asString(stream));
formParameters.add(formParameter);
}
}