Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.2
-
None
-
None
-
Linux (Fedora Core 3)
Java 1.4.2_08
Axis 1.2 (final)
Commons HttpClient 3.0rc2
Description
I am using Axis 1.2 (final) with the Commons HTTPClient 3.0rc2. I
am using these libraries to create a SOAP client using the SAAJ API. When I send a SOAPMessage, the http headers contain two copies of the SOAPAction.
There seems to be a bug in org.apache.axis.transport.http.CommonsHTTPSender. Here is what is happening:
1) Create a SOAPMessage
2) set the SOAPAction MIME header in a SOAPMessage:
soapMsg.getMimeHeaders().setHeader("SOAPAction", "someaction");
3) Invoke SOAPConnection.call(). The "SOAPAction" gets written to the http headers two times.
My client code has always worked fine in the past when using the Sun SAAJ implementation and when using the standard Axis HttpSender. This problem only showed up when I switched to using the CommonsHTTPSender.
It looks like the CommonsHTTPSender is missing some logic which can be found in HttpSender. Here is a patch against Axis 1.2 (final) which fixes the problem.
477a478,482
> String headerName = mimeHeader.getName();
> if (headerName.equals(HTTPConstants.HEADER_CONTENT_TYPE) ||
> headerName.equals(HTTPConstants.HEADER_SOAP_ACTION))