How to send PDF file to TN Partner over AS2 via HTTP

Hi Experts,

We are having a requirement in which we have to send a PDF file over AS2 via HTTP request.

I have already achieved to send CSV/XML file via EDIINT:send service but PDF cannot be implemented same way.

I am currently trying with MIME Object creation but no success yet.
I am not aware how to implement MIME objects in Webmethods.

Has anyone of you implemented this thing ever before.

Please update. its a bit urgent.

Thanks in Advance

Nope…but you try setting content type as Application/Octect-Stream or Application/pdf and send it?


you can call service: wm.EDIINT:send to send pdf in as2
there is
contentType <-- you can populate this with application/pdf
stream <-- put your pdf as stream type here

Thanks RMG and tongwang for such a precise and quick reply.

I am now able to send the PDF as a stream to partner but I am not sure whether the stream data that I am sending is correct or not.

Is there a way to convert the stream contents available in PAyload back to PDF to verify partner will also receive the same PDF or not.

Please refer the stream data in attached file.

Really appreciate your help guys.

streamData.txt (6.86 KB)

Streamdata cannot be readable…

Or you can send EDIINT:send to another internal dev/qa system and test that end if you receive that payload…How are you persisting this document in TN?

ok try that stream data send to smtp attachment and content type application/pdf…


Thanks RMG.

I have tried to do smtp and provided content type as application/pdf but pdf that is getting is generated is not having any data in it.

I have even tried to make a WORD document but is ask for encoding to be used. It shows the data that I have attached as stream.txt in mny last reply.


Also then try with application/octect-stream

If not may be try with mime types/objects…


Sorry rmg… but this also didn’t wroked out …

Can you try this in your system ?.. Could be possible i m making a mistake…

Finally Sorted it out…

By setting the encoding type to “uuencode” , I was able to generate the PDF successfully.

So I just need to inform the trading partner about this encoding type and they will be able to re generate the PDF at their end.

Thanks RMG for your help.
Much appreciated. :slight_smile:


Glad you got it resolved:

Hi experts,

Got stuck in one more issue while sending PDF file over AS2 via http.

Trading partner is getting filename as “smime.p7m”.
I need to provide the orginal filename into this filename variable.

Current situation:
"content-disposition = attachment; filename=smime.p7m

What I need:
content-disposition = attachment; filename=INV_110829_00000004.csv

I am able to send another parameter like “filename1” in EDIINT Data header but trading partner functionality is only recognizing filename present in content-disposition only.

Is there any way to provide custom filename to filename present in content-disposition?

Disposition-notification-to: *****
Disposition-notification-options: signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha1
AS2-From: ****
AS2-To: b2b
AS2-Version: 1.1
filename1: INV_110829_00000004.csv
Content-Type: application/pkcs7-mime; name=smime.p7m; smime-type=enveloped-data
Content-Disposition: attachment; filename=smime.p7m


Resolved it myself…

WE need to manually set the content-disposition value in MIME Header before hand.
This variable gets created at runtime ,so you need to create this variable in mime header and assign any value that you want to display.


Hi Amit,
Could you please let us know how you resolved in changing the Content-Disposition filename?


Hi Vijay,

You need to customize EDIINT:send service to have your own “Content-disposition”.

  1. Open and lock EDIINT:send service …
  2. Go to “wm.EDIINT.util.mime:getStreamMimeHeader” service in Sequence “Prepare to Submit”.
  3. In pipeline out there is a document named “mimeHeader”. Add a new field “Content-disposition” inside that document and map it to your desired filename.
  4. Run it and you can see customized filename in TN transaction.

I hope this helps.

fyi…you shouldn’t be customizing/edit the proprietary built in flows out of box packages provided and also this is not supported by SAG/advises customers unless you deal with at your own risk.

I understand some times tweaks are needed but:


Hi Vijay,

I forgot to mention one thing.
You need to create a copy of EDIINT:send service in your own package and rename it to something like EDIINT:customSend and make changes in that service only.
As suggested by RMG, SAG will not support any customization done to built in packages.


Yes that is the only way to go:

Hi All,

Did someone process and extracted encrypted PDF coming in from partner and generated a PDF file with all the data correctly.
Urgent help required, any help is appreciated.


Please check this thread and may be you need to use fop libraries handling pdf’s and base64 encode/decode
for handling application/pdf depends on what version of IS 8.x or 9.x or so.


Thanks RMG for the suggestion.
Sorted it out, use the stream generated after the bytes segregation(in the inbuilt Processmsg service) of the part and then channeling it to the folder location.