Expand my Community achievements bar.

Invoke a Process Over HTTP using a Document


Level 7

I have created a servlet to accept a PDF submission and invoke a process by passing the same PDF, using an EJB endpoint. Has anyone done this? I need to know whether the InputStream needs to be serialized? if yes, how?


1 Reply


Level 8

Its been a while, but I remember using the ServletUtils.getRequestBufferAsBytes to process the request object before I could create a com.adobe.idp.Document object:

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            byte[] content = ServletUtils.getRequestBufferAsBytes(request);
            Document uploadedDoc = new Document(content);