Can WebMethods ESB abble to fill accrofields PDF (is it a good practice)


I need to make the ESB webMethods abble to expose web services that fill some fields inside PDF files and then return the files (with MTOM.

Initially, I was thinking about spare with the ESB, leaving him its own tasks : generating PDF task would be another application which have to publish the filled PDF files.

Do you think this is a good way to confide nevertheless this task to the ESB ?

I easily could load some jar library (like IText) and then ask the ESB to fill the data and then produce the PDF file, all that process would be a lot more simple and the lenght of process (nb steps) would be the shorter one.
What solution would you advise me ?

A last question (maybe I should began by this one) : Is the ESB abble to deal with filling PDF in a native way ?


There is no native way in Integration server to either fill in the details in PDF or to create one. Your approach and thought process is absolutely right. It is always good to limit ESB to the tasks it is defined to do and let some seperate process to handle these kind of jobs. As you mentioned, I would suggest you to go with a library like Itext to do your PDF job and then use the Integration server’s inbuilt MTOM feature to stream your file back.


Thanks for your reply.

but if I let this task to another application process which prepares the pdf stream by web service to the ESB, when this last sends the same stream to the distant client, this costs a little more time of stream processing…
Unless I leave the first process to just copy the generated pdf in a filesystem, and let the ESB to get directly the file ?

The ESB and the first application would obviously be in the same Lan, so maybe the streaming file process or get directly the file from the F-S does not change significantly the complete processing time ?


PS : all the PDF already exist, for 1 call and 1 pdf, the operation just needs to fill a dozen of fields, and save the new pdf … so i’m hesitating if the game is worth the candle … to mount a new application ?

Yes, Cedric. True. What I meant by a separate process is not a separate application itself. I was referring to a Java service utility that can do this job. Also, if all your files are on the same system or network by design, then why do you even want to play with streams. You can just use references to the file path in your request and let the service update the fields and save the PDF at the same location or to a different folder the in the same place and just send a positive or negative ACK as the response. This way you can save the MTOM streaming part

I’m not sure to understand… you mean a “Java service” inside the ESB (the one created from the Designer) ?

Initially, I was refering another web service but out of the ESB : a library that encapsulates the filling PDF mecanism and then, whish publishes this WAR service in a Tomcat, to have an independent service.

Yes, you’re right, I’m working about creating the new file, for the ESB to directly get it.


Oops…sorry. I was confused “application” with “module.” Yes, a separate application (running on Tomcat) would cost some network latency. And a separate module (Java service) would still run in ESB but saves cost. If all your files are accessible in a same network or system according to your design, then I would suggest you go with a Java module in ESB

Thanks Pradas.
If I create a Java service in the ESB, it means an new Java module…
So if the Java module run inside the ESB, It will not run a separate process, I suppose (same processes for modules and ESB services)…

So in your opinion, adding the adding IText library JAR inside a package and calling/implementing it from a Java service (in ESB) would be acceptable as a good practice ?


Hi Cedric,

Please spare my choice of wordings (application, module, service, etc…) here, but in short, yes, that is what I mean.
Also, best practices change based on context/ scenario/ design, etc. Considering your design and scenario, yes, In my opinion, having a Java service with third party library inside ESB just to fill in the details in the PDF is a better way as it saves a lot of round trips on network and memory footprint on the server during file streaming.

Yes I understand what you mean Prasad, it depends on a lot of things.
Thanks a for your help and quick replies :smiley: .