Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper 7.1 REST V2 services || how to post success fully


SETTURGOPI

Recommended Posts

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...