Closed mayousheng closed 2 months ago
What do you mean the "original" message? Do you mean a) the message how it is transmitted on the network level or b) the source message of an MDN?
Dear Philip,
I'm sorry I wasn't clear.
I want to get the http message information of as2 request. This should be a)
It should look something like this
` POST /as2/receive HTTP/1.1 Host: example.com User-Agent: MyAS2Client/1.0 Connection: keep-alive Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="----=_Part_123456_789123456.7891234567890" Content-Length: 12345 AS2-Version: 1.2 AS2-From: MyAS2SenderID AS2-To: MyAS2ReceiverID Message-ID: 1234567890@example.com Disposition-Notification-To: as2@example.com Disposition-Notification-Options: signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha-256 Recipient-Address: http://example.com/as2/receive Subject: AS2 Test Message MIME-Version: 1.0 Content-Transfer-Encoding: binary
------=_Part_123456_789123456.7891234567890 Content-Type: application/edi-x12 Content-Transfer-Encoding: binary Content-Disposition: attachment; filename="testfile.txt"
[File content omitted]
------=_Part_123456_789123456.7891234567890--
------=_Part_123456_789123456.7891234567891 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: binary Content-Disposition: attachment; filename="smime.p7s"
[Signature content omitted]
------=_Part_123456_789123456.7891234567891-- `
The following lines in the AS2SenderModule
caught my attention. Perhaps I can find the desired message here?
I added the interfaces IHTTPOutgoingDumper
and IHTTPIncomingDumper
to exactly perform these issues.
For sending messages, you can provide these dumpers via the AS2ClientSettings
class.
For receiving, you need to adopt the AS2ReceiveXServlet....
handler accordingly (or set the dumper globally via HTTPHelper.setHTTPIncomingDumperFactory
)
ok, I tried it this way and it worked for me. Thank you for your help
Dear Philip, I want to get the original message of AS2Message, how should I get it?
Thanks,