Hi Melodias,

The solution provided at [1]
<https://stackoverflow.com/questions/44612658/how-to-respond-application-pdf-content-from-wso2-esb>
would be helpful.

Thanks,
Prabushi

[1] -
https://stackoverflow.com/questions/44612658/how-to-respond-application-pdf-content-from-wso2-esb

On Fri, Jan 26, 2018 at 6:05 PM, Hasunie Adikari <[email protected]> wrote:

> Hi,
>
> You can create a soap service which will respond to PDF.
> For an instance :
>
> <proxy xmlns="http://ws.apache.org/ns/synapse"; name="Sample"
> startOnLoad="true" statistics="disable" trace="disable"
> transports="http,https">
>     <target>
>         <inSequence>
>             <dblookup>
>                 <connection>
>                     <pool>
>                         <dsName>pgConn</dsName>
>                     </pool>
>                 </connection>
>                 <statement>
>                     <sql>select pdf_base64 from pdf_files where id =
> ?</sql>
>                     <parameter xmlns:nb="http://mru"; expression="//nb:id"
> type="INTEGER"/>
>                     <result column="pdf_base64" name="pdf_base64"/>
>                 </statement>
>             </dblookup>
>             <payloadFactory media-type="xml">
>                 <format>
>                     <ns:binary xmlns:ns="http://ws.apache.
> org/commons/ns/payload">$1</ns:binary>
>                 </format>
>                 <args>
>                     <arg evaluator="xml" expression="get-property('pdf_
> base64')"/>
>                 </args>
>             </payloadFactory>
>             <loopback/>
>         </inSequence>
>         <outSequence>
>             <script language="js">
>             var binaryNode = mc.getEnvelope().getBody().getFirstElement().
> getFirstOMChild();
>             binaryNode.setBinary(true);
>             </script>
>             <property name="messageType" scope="axis2" type="STRING"
> value="application/pdf"/>
>             <respond/>
>         </outSequence>
>     </target>
>     <description/>
> </proxy>
>
> Regards
> Hasunie
>
>
> On Fri, Jan 26, 2018 at 2:48 PM, Melodias <[email protected]>
> wrote:
>
>> Hi,
>> How I can receive in response application/pdf from backend service using
>> ESB?
>>
>> best regards
>> Melodias
>>
>>
>>
>> --
>> Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development
>> -f3.html
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
>
> --
> *Hasunie Adikari*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> blog http://hasuniea.blogspot.com | https://medium.com/@Hasunie/
> Mobile:+94713095876 <+94%2071%20309%205876>
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Prabushi Samarakoon*
Software Engineer
Mobile: +94715434580
Email: [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to