I'm not familiar with all the details of AS2 and MDN's, but is there a standard way of determining if an MDN represents failure?
From what I can see you do this in the file AS2MessageParser.java in createMessageFromRequest() using this code:
if( mdnParser.getDispositionState().toLowerCase().indexOf( "error" ) > 0 )
But in testing various error scenarios I've got a response (from a Bizlink server) that looks like this, and mec_as2 is thinking everything is ok.
to = XXX
as2-from = YYY
from = YYY
connection = close
server = Apache-Coyote/1.1
date = Mon, 18 Sep 2006 16:33:46 GMT
as2-to = XXX
as2-version = 1.1
content-type = multipart/report; report-type=disposition-notification; boundary="--=boundary-mdn"
content-length = 1109
message-id =
subject = Message Disposition Notification
The message sent on Mon, 18 Sep 2006 12:33:42 EDT
from [XXX] to [YYY]
with subject [AS2 message] and
message ID of []
has been [failed/Failure: message-deemed-invalid-due-to-unknown-from-and.or-to-parties].
Message was NOT processed : Cannot find originating party using the AS2-FROM ident [XXX]
So should the code also be checking for the word "fail", or is Bizlink sending a non-standard response?
Thanks.
demerit,
I have to lookup if this is standard or not. But - we are interested in compatibility to a wide range of AS2 servers. We will add the code to be compatible to this as2 server.
It would be great if you could send me the full MDN and the name of the product for a later upcoming compatibility list. My email is sh at mendelson dot de.
I will also add a subforum compatibility where all of you could add product names you have exchanged successfully (or not) AS2 messages with using m-e-c as2.
Best regards
Heller
demerit,
In rfc 4130 there is described an expected header field called "Disposition".
A sample for this structure is the following:
------=_Part_579_23750105.1158683019802
Content-Type: message/disposition-notification
Content-Transfer-Encoding: 7bit
Reporting-UA: mendelson AS2 Server
Original-Recipient: rfc822; mendelsontestAS2
Final-Recipient: rfc822; mendelsontestAS2
Original-Message-ID: <mec_as2-1158683025687-75709@mycompanyAS2_mendelsontestAS2>
Disposition: automatic-action/MDN-sent-automatically; processed
------=_Part_579_23750105.1158683019802--
This is how it is described in the rfc:
AS2-disposition-field =
"Disposition" ":" disposition-mode ";"
AS2-disposition-type [ '/' AS2-disposition-modifier ]
disposition-mode =
action-mode "/" sending-mode
action-mode =
"manual-action" | "automatic-action"
sending-mode =
"MDN-sent-manually" | "MDN-sent-automatically"
AS2-disposition-type =
"processed" | "failed"
AS2-disposition-modifier =
( "error" | "warning" ) | AS2-disposition-modifier-extension
AS2-disposition-modifier-extension =
"error: authentication-failed" |
"error: decompression-failed" |
"error: decryption-failed" |
"error: insufficient-message-security" |
"error: integrity-check-failed" |
"error: unexpected-processing-error" |
"warning: " AS2-MDN-warning-description |
"failure: " AS2-MDN-failure-description
Anyway, please send me the MDN and we will implement something ;)
Regards
Heller
Ok, I sent you the full MDN.
According to the RFC you posted, where it says
AS2-disposition-type = "processed" | "failed"
this indicates the code should be checking for "failed" and not "error".
I guess it is coincidence that the current code is usually working, because most servers will have "error" somewhere in the text, but according to the RFC it is not required to say "error".
Thanks.
demerit,
thank you. We modified the code, in the next build this will work.
Best regards
Heller