SETTURGOPI Posted September 19, 2018 Share Posted September 19, 2018 Hi Team,we are using Jasper 7.1 on tomcat 8.5.27 and trying to post JRXML. How ever it is not access ful.Please review the code we use and advise if anything is missing. MultipartEntity multipartEntity = null; HttpPost generateReport = new HttpPost("http://localhost:8080/app/rest_v2/resources"); multipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); System.out.println(" fileRd "+fileRd); String requestXml = IOUtils.toString(new FileInputStream(fileRd)); // System.out.println(" requestXml "+requestXml); multipartEntity.addPart(REQUEST_PARAMENTER_RD, new StringBody(requestXml)); multipartEntity.addPart("http:// localhost:8080/app/rest_v2/resources", new FileBody(new File("resources/reports/DDD/DDD_008_01.jrxml"))); generateReport.setEntity(multipartEntity); HttpResponse httpResponse = httpClient.execute(generateReport, httpContext);[/code] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now