How to pass the whole pdf content as response in Restful web services using java platform. I tried with converting the responses to String and byte array. First case, got registered expression error. In Second case, getting unexpected results.
PDF data should be transferable as a response of a rest-ful request just fine.
Set the correct content type and transfer the binary content of the PDF.
Nothing special about it.
- What are you doing right now? Are you using an library?
- Describe your "unexepected results".
- Describe your "expression error"
Basically, you need to provide a lot more details.
Your responses from the Java platform are most definitely going to be byte arrays in order to provide the PDF. From the server side you need to make sure that MIME types for PDF are registered and that it's providing and accepting the correct headers for PDF.
If you're serving PDF, Java needs to figure out where that is and hosted under the url that you defined your RESTful resource.
If it's dynamic, your PDF library (I've used iText in the past) needs to be able to output the PDF binary and serve it via your defined RESTful resource.
Not sure if this is related to your problem - but I have seen that Adobe Acrobat doesn't handle HTTP Range headers well and if you say you except Ranges it will throw some very weird Range requests and ignore the partial content headers you send back. Just a warning.