Details
Description
The third party AS2 server that we are calling is returning the MDN response in which the disposition field is like
Ex: "Disposition: automatic-action/MDN-Sent-automatically; processed"
As per the AS2 spec (https://www.ietf.org/rfc/rfc4130.txt) this field can be case insensitive, but camel as2 validates this field with case sensitive hence it fails.
For reproducing the issue, please use the attached "DispositionNotificationContentUtilsTest.java" file.
Failed to parse entity content at org.apache.camel.support.component.ApiMethodHelper.invokeMethod(ApiMethodHelper.java:531) at org.apache.camel.support.component.AbstractApiProducer.doInvokeMethod(AbstractApiProducer.java:122) at org.apache.camel.support.component.AbstractApiProducer$1.run(AbstractApiProducer.java:89) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:836) Caused by: org.apache.http.HttpException: Failed to parse entity content at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartSignedEntity(EntityParser.java:365) at org.apache.camel.component.as2.api.entity.EntityParser.parseAS2MessageEntity(EntityParser.java:472) at org.apache.camel.component.as2.api.io.AS2BHttpClientConnection.receiveResponseEntity(AS2BHttpClientConnection.java:55) at org.apache.http.impl.conn.CPoolProxy.receiveResponseEntity(CPoolProxy.java:162) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.camel.component.as2.api.AS2ClientConnection.send(AS2ClientConnection.java:192) at org.apache.camel.component.as2.api.AS2ClientManager.send(AS2ClientManager.java:391) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.camel.support.component.ApiMethodHelper.invokeMethod(ApiMethodHelper.java:523) ... 8 more Caused by: org.apache.http.ParseException: failed to parse text entity at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartSignedEntityBody(EntityParser.java:602) at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartSignedEntity(EntityParser.java:357) ... 20 more Caused by: org.apache.http.ParseException: failed to parse EDI entity at org.apache.camel.component.as2.api.entity.EntityParser.parseEntityBody(EntityParser.java:858) at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartSignedEntityBody(EntityParser.java:548) ... 21 more Caused by: org.apache.http.ParseException: failed to parse text entity at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartReportEntityBody(EntityParser.java:710) at org.apache.camel.component.as2.api.entity.EntityParser.parseEntityBody(EntityParser.java:826) ... 22 more Caused by: org.apache.http.ParseException: failed to parse MDN entity at org.apache.camel.component.as2.api.entity.EntityParser.parseMessageDispositionNotificationEntityBody(EntityParser.java:777) at org.apache.camel.component.as2.api.entity.EntityParser.parseMultipartReportEntityBody(EntityParser.java:699) ... 23 more Caused by: org.apache.http.ParseException: Invalid 'Disposition' field: invalid disposition mode 'automatic-action/MDN-Sent-automatically' at org.apache.camel.component.as2.api.util.DispositionNotificationContentUtils.parseDispositionNotification(DispositionNotificationContentUtils.java:197) at org.apache.camel.component.as2.api.entity.EntityParser.parseMessageDispositionNotificationEntityBody(EntityParser.java:772) ... 24 more