Buggy code:
public String getProxyHost ( ) { } public void setProxyPort ( String port ) { } public int getProxyPort ( ) { } public void setWsdlURL ( String url ) { } public String getWsdlURL ( ) { } private void checkProxy ( ) { } private Element createDocument ( ) { } protected Document openDocument ( String file ) { } protected HTTPSampleResult sample ( URL u , String s , boolean b , int i ) { } public SampleResult sample ( ) { SampleResult result = new SampleResult ( ) ; result . setSuccessful ( false ) ; result . setResponseCode ( "000" ) ; result . setSampleLabel ( getName ( ) ) ; try { result . setURL ( this . getUrl ( ) ) ; Element rdoc = createDocument ( ) ; if ( rdoc == null ) throw new SOAPException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>document" , null ) ; Envelope msgEnv = Envelope . unmarshall ( rdoc ) ; Message msg = new Message ( ) ; result . sampleStart ( ) ; SOAPHTTPConnection spconn = null ; if ( ( ( this . getHeaderManager ( ) ) != null ) && ( ( this . getHeaderManager ( ) . getSOAPHeader ( ) ) != null ) ) { spconn = ( ( SOAPHTTPConnection ) ( this . getHeaderManager ( ) . getSOAPHeader ( ) ) ) ; } else { spconn = new SOAPHTTPConnection ( ) ; } if ( ( getAuthManager ( ) ) != null ) { if ( ( getAuthManager ( ) . getAuthForURL ( getUrl ( ) ) ) != null ) { AuthManager authmanager = getAuthManager ( ) ; Authorization auth = authmanager . getAuthForURL ( getUrl ( ) ) ; spconn . setUserName ( auth . getUser ( ) ) ; spconn . setPassword ( auth . getPass ( ) ) ; } else { WebServiceSampler . log . warn ( ( "the<seq2seq4repair_space>URL<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>auth<seq2seq4repair_space>was<seq2seq4repair_space>null." + "<seq2seq4repair_space>Username<seq2seq4repair_space>and<seq2seq4repair_space>password<seq2seq4repair_space>not<seq2seq4repair_space>set" ) ) ; } } String phost = "" ; int pport = 0 ; if ( this . getUseProxy ( ) ) { if ( ( ( this . getProxyHost ( ) . length ( ) ) > 0 ) && ( ( this . getProxyPort ( ) ) > 0 ) ) { phost = this . getProxyHost ( ) ; pport = this . getProxyPort ( ) ; } else { if ( ( ( System . getProperty ( "http.proxyHost" ) ) != null ) || ( ( System . getProperty ( "http.proxyPort" ) ) != null ) ) { phost = System . getProperty ( "http.proxyHost" ) ; pport = Integer . parseInt ( System . getProperty ( "http.proxyPort" ) ) ; } } if ( ( ( phost . length ( ) ) > 0 ) && ( pport > 0 ) ) { spconn . setProxyHost ( phost ) ; spconn . setProxyPort ( pport ) ; } } spconn . setMaintainSession ( true ) ; msg . setSOAPTransport ( spconn ) ; msg . send ( this . getUrl ( ) , this . getSoapAction ( ) , msgEnv ) ; if ( ( this . getHeaderManager ( ) ) != null ) { this . getHeaderManager ( ) . setSOAPHeader ( spconn ) ; } SOAPTransport st = msg . getSOAPTransport ( ) ; result . setDataType ( TEXT ) ; BufferedReader br = null ; if ( ( st != null ) && ( ( st . receive ( ) ) != null ) ) { br = st . receive ( ) ; if ( getReadResponse ( ) ) { StringBuffer buf = new StringBuffer ( ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { buf . append ( line ) ; } result . sampleEnd ( ) ; result . setResponseData ( buf . toString ( ) . getBytes ( ) ) ; } else { br . read ( ) ; result . sampleEnd ( ) ; result . setResponseData ( JMeterUtils . getResString ( "read_response_message" ) . getBytes ( ) ) ; } result . setSuccessful ( true ) ; result . setResponseCodeOK ( ) ; result . setResponseHeaders ( this . convertSoapHeaders ( st . getHeaders ( ) ) ) ; } else { result . sampleEnd ( ) ; result . setSuccessful ( false ) ; result . setResponseData ( st . getResponseSOAPContext ( ) . getContentType ( ) . getBytes ( ) ) ; result . setResponseHeaders ( "error" ) ; } result . setSamplerData ( fileContents ) ; <START_BUG> result . setDataEncoding ( st . getResponseSOAPContext ( ) . getContentType ( ) ) ; <END_BUG> if ( br != null ) { br . close ( ) ; } } catch ( IllegalArgumentException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } catch ( SOAPException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } catch ( MalformedURLException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } catch ( IOException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } catch ( MessagingException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } return result ; } public void addEncodedArgument ( String name , String value , String metaData ) { } public String convertSoapHeaders ( Hashtable ht ) { } }

Fix:
result . setEncodingAndType ( st . getResponseSOAPContext ( ) . getContentType ( ) ) ;