Search code examples
wso2jasperserverwso2-esb

How to receive an HTML attachment in WSO2 ESB


I have a need to call a jasperreports server from WSO2 ESB to generate a PDF. The REST API of Jasperserver sends this back as an attachment in a HTTP response.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Thu, 01 Jan 1970 01:00:00 CET
P3P: CP="ALL"
Content-Disposition: attachment; filename="Report.pdf"
output-final: true
Content-Type: application/pdf
Content-Length: 12060
Date: Tue, 22 Sep 2015 15:22:50 GMT

%PDF-1.4

WSO2 ESB cannot parse this - how can I make this work, so I can process the generated PDF?

ESB Error:

TID: [0] [ESB] [2015-09-22 17:13:16,326] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} 
-  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils} 
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.

Solution

  • Did you try to configure the binary relay ? Maybe the following link can help you: docs.wso2.com/display/ESB481/Configuring+Message+Relay