Hi all. I'm dealing with a possible bug in Soap Context mapper when the client is using HTTP Chunking. Please see the attached sample project. Steps to reproduce:
Error description: When the client uses HTTP chunking it will send the "transfer-encoding:chunked" header instead of the content-length header. While Composing the response message the switchyard class org.switchyard.component.soap.composer.SOAPContextMapper copies the headers from the request to the response. In the mapTo(Context context, SOAPBindingData target) function we can see that it checks the list HTTP_HEADERS_EXCLUDED to ignore some headers that cannot be copied. For example the "content-type" and "content-length". Since the transfer-encoding header is not included in HTTP_HEADERS_EXCLUDED list it is also copied to the response. So the client will receive the "transfer-encoding" header and the "content-length" header simultaneously. Since receiving both headers is not an expected behavior the client can have problems while reading the response. For example CXF keeps waiting indefinitely for the last chunk until timeouts. For a temporary fix I've added a custom context mapper(com.example.switchyard.switchyard_example.impl.CustomContextMapper) that removes the transfer-encoding header after the execution of the SOAPContextMapper mapTo. Fix Add "transfer-encoding" to the HTTP_HEADERS_EXCLUDED list. Github fork with the correction: GitHub - hugo-ma-alves/switchyard: Aggregated SwitchYard repository Regards Hugo Alves |