Hello,
I am trying to figure out what are the constraints on the MIME headers
that can be set on the SOAP request.
Our application by accident was copying HTTP request from the original
HTTP request coming to our system to a SOAP message which was later
sent to another system. There was Expect: 100-continue header among
them as our customer was setting that header (
http://bit.ly/197y0w2).
When we upgraded to Java 7 we found out that for every SOAP request we
made which had Expect header set we had 5 seconds delay before the SOAP
request was sent over the wire. It turned out that HTTP client in Java
7 got support for Expect header and when it sees it set on the HTTP
request (and it is populated from MIME headers to HttpURLConnection by
HttpSOAPConnection -
http://bit.ly/10mYEw7 - lines 216 to 246) it also
requires that streaming is used (which is not set by
HttpSOAPConnection). More information on the OpenJDK mailing list:
http://bit.ly/ZTyx4i
From the SAAJ Javadoc:
http://bit.ly/10Kx0J5
<quote>
headers - the transport-specific headers passed to the message in a
transport-independent fashion for creation of the message
</quote>
My understanding is that it is allowed to set the Expect header as
MimeHeader. If that is a correct statement, then HttpSOAPConnection
should also use streaming. Otherwise one can see a 5 seconds delay for
every request with Expect header set.
Could you please clarify the situation if it is correct to set such
headers?
Best regards,
Piotr