Bug 48451

Summary: Error in: SoapSampler.setPostHeaders(PostMethod post) in the else branch
Product: JMeter - Now in Github Reporter: Carol Gagne <carol.gagne>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Carol Gagne 2009-12-28 08:12:12 UTC
In class: org.apache.jmeter.protocol.http.sampler.SoapSampler
Method: setPostHeaders(PostMethod post)
Source file line: 143
....
} else {
            // otherwise we use "text/xml" as the default
            post.addParameter(HEADER_CONTENT_TYPE, DEFAULT_CONTENT_TYPE); 
        }...

I believe it should be something like

        } else {
            // otherwise we use "text/xml" as the default
            post.setRequestHeader(HEADER_CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
        }

How to reproduce: Make sure no header manager is null (not set).
Capture the content of the call (with TCPMon for exemple). You will see the default content type does not appear in HTTP Header but in the content.

Regards
Comment 1 Sebb 2009-12-29 19:16:57 UTC
Thanks for the report and suggested fix.

This has been applied to SVN:


URL: http://svn.apache.org/viewvc?rev=894535&view=rev
Log:
Bug 48451 - Error in: SoapSampler.setPostHeaders(PostMethod post) in the else branch

and will be in nightly builds after r894535
Comment 2 The ASF infrastructure team 2022-09-24 20:37:44 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2323