Content length already present error soapUI 4.5.1

user1088166 picture user1088166 · Jul 2, 2012 · Viewed 20.4k times · Source

I've recently started using soapUI 4.5.1 and I'm still not familiar with all the settings. I've set up a few web requests and all but one are working correctly. I'm trying to send content of type application/xml but I'm getting:

org.apache.http.client.ClientProtocolException caused by org.apache.http.ProtocolException: Content-Length header already present.

The same request always worked fine for me in 4.5.0. Content of request is something like this:

POST http://exampleHost.com/exampleRequest HTTP/1.1
Accept-Encoding: gzip,deflate
Accept: text/xml
Content-Type: application/xml
Content-Length: 456
Host: exampleHost.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Followed by the xml.

I take it that content length is sent twice, but I don't know where, because I haven't set it anywhere. SoapUI is showing Additional HTTP Headers for this message as 0.

Any pointers would be great!

Answer

CroesusKall picture CroesusKall · Mar 8, 2013

I got the error to go away (in SoapUI 4.5.1) by checking the Authenticate Preemptively flag in

Preferences -> HTTP Settings -> Authenticate Preemptively