Expect 100-continue header for Web service call (Azure)

1
From our Mendix app we need to call a Webservice to upload files to an external system. This external service is running on Azure. A simple test call, using a pretty small Base64encoded Content works fine: <soapenv:Header/> <soapenv:Body>     <ns:AddDossierDocuments>         <ns:value>             <ns:DossierDocument>                 <ns1:Attachments>                     <ns1:Attachment>                         <ns1:AttachmentID>5112531</ns1:AttachmentID>                         <ns1:Name>test.pdf</ns1:Name>                         <ns1:Content>dGVzdCB2YW4gRWR3aW4=</ns1:Content>                     </ns1:Attachment>                 </ns1:Attachments>             </ns:DossierDocument>         </ns:value>     </ns:AddDossierDocuments> </soapenv:Body> When trying to send larger files, a timeout occurs (> 2 minutes) and Mendix does not get a correct response. Testing from SoapUI tool, gives the same timeout: Thu May 16 15:23:13 CEST 2019:DEBUG:>> "POST /Service.svc HTTP/1.1[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "SOAPAction: "http://xxx.xx/Service/AddDossierDocuments"[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "Content-Length: 1285229[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "Host: xxx.azurewebsites.net[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "Connection: Keep-Alive[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]" Thu May 16 15:23:13 CEST 2019:DEBUG:>> "[\r][\n]" => timeout When testing from SoapUI tool, we are able to activate an option (HTTP Settings: Adds Expect-continue header to outgoing request) to add an extra HTTP header: Expect: 100-continue. After sending this extra HTTP header, a 100 Continue request is received and file gets uploaded fine: Thu May 16 15:25:43 CEST 2019:DEBUG:>> "POST /Service.svc HTTP/1.1[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "SOAPAction: "http://xxx.xx/Service/AddDossierDocuments"[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Content-Length: 1285229[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Host: xxx.azurewebsites.net[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Connection: Keep-Alive[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "Expect: 100-continue[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:<< "HTTP/1.1 100 Continue[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:<< "[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="xxx" xmlns:ns1="xxx" xmlns:ns2="xxx">[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "   <soapenv:Header/>[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "   <soapenv:Body>[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "      <ns:AddDossierDocuments>[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "         <!--Optional:-->[\r][\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "[0x9][0x9]<ns:value>[\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "[0x9][0x9][0x9]<ns1:DossierDocument>[\n]" Thu May 16 15:25:43 CEST 2019:DEBUG:>> "[0x9][0x9][0x9][0x9]<ns2:Identification>02</ns2:Identification>[\n]" Seems like this Expect 100 header is needed for Azure webservices, see also: https://stackoverflow.com/questions/22564285/azure-is-forcing-client-to-send-http-expect-100-continue-with-large-data-request In Mendix I was able to add the custom HTTP header to the Webservice call (Key=Expect, Value='100-continue'). The request timeout does not appear anymore, but I guess Mendix does not know how to wait for and handle the HTTP/1.1 100 Continue header received now. After a few seconds Mendix shows the following response in console log: Response message received in Tube [ MesageDumpingTube ] Instance [ 1 ] Engine [ Metro/2.1 (branches/2.1-6728; 2011-02-03T14:14:58+0000) JAXWS-RI/2.2.3 JAXWS/2.2: Stub for https://xxx.azurewebsites.net/Service.svc ] Thread [ MxRuntimeSystem-action-dispatcher-14 ]: <?xml version='1.0' encoding='UTF-8'?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">   <s:Body>     <s:Fault>       <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>       <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.</faultstring>     </s:Fault>   </s:Body> </s:Envelope> Does anybody know whether Mendix (Project is using Mendix v6.10.3) is able to handle to Expect: 100-continue header for Web Services? Or is a workaround available to be able to use this webservice? Regards, Edwin van Elk
asked
1 answers
2

If someone might have the same question, this is the reply from Mendix support:


After internal discussion about your request, we confirm that support for the "100 Continue" HTTP header currently not supported in Mendix platform. We submitted the feature request with our R&D team for implementation, at this moment we can not provide you with the ETA for the solution to be rolled out. In support we do not track the feature requests as we can not influence the planning of them. We kindly advise you to keep an eye on the release notes for the updates: https://docs.mendix.com/releasenotes/

answered