Buggy code:
result . setDataType ( TEXT ) ; result . setSamplerData ( fileContents ) ; 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 ( ) ; } spconn . setTimeout ( getTimeoutAsInt ( ) ) ; 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 ) ; if ( ( ( WebServiceSampler . PROXY_USER . length ( ) ) > 0 ) && ( ( WebServiceSampler . PROXY_PASS . length ( ) ) > 0 ) ) { spconn . setProxyUserName ( WebServiceSampler . PROXY_USER ) ; spconn . setProxyPassword ( WebServiceSampler . PROXY_PASS ) ; } } } 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 ( ) ; BufferedReader br = null ; if ( ( st != null ) && ( ( st . receive ( ) ) != null ) ) { br = st . receive ( ) ; SOAPContext sc = st . getResponseSOAPContext ( ) ; final String contentType = sc . getContentType ( ) ; result . setContentType ( contentType ) ; result . setEncodingAndType ( contentType ) ; if ( getReadResponse ( ) ) { StringWriter sw = new StringWriter ( ) ; IOUtils . copy ( br , sw ) ; result . sampleEnd ( ) ; result . setResponseData ( sw . toString ( ) . getBytes ( result . getDataEncodingWithDefault ( ) ) ) ; } else { br . read ( ) ; result . sampleEnd ( ) ; result . setResponseData ( JMeterUtils . getResString ( "read_response_message" ) . getBytes ( ) ) ; } result . setSuccessful ( true ) ; result . setResponseCodeOK ( ) ; } else { result . sampleEnd ( ) ; result . setSuccessful ( false ) ; if ( st != null ) { final String contentType = st . getResponseSOAPContext ( ) . getContentType ( ) ; result . setContentType ( contentType ) ; result . setEncodingAndType ( contentType ) ; <START_BUG> result . setResponseData ( st . getResponseSOAPContext ( ) . toString ( ) . getBytes ( ) ) ; <END_BUG> } } if ( st != null ) { SOAPContext sc = st . getResponseSOAPContext ( ) ; result . setResponseHeaders ( convertSoapHeaders ( sc . getRootPart ( ) . getAllHeaderLines ( ) ) ) ; } else { result . setResponseHeaders ( "error" ) ; } if ( br != null ) { br . close ( ) ; } } catch ( IllegalArgumentException exception ) { String message = exception . getMessage ( ) ; WebServiceSampler . log . warn ( message ) ; result . setResponseMessage ( message ) ; } catch ( SAXException exception ) { WebServiceSampler . log . warn ( exception . toString ( ) ) ; result . setResponseMessage ( exception . getMessage ( ) ) ; } catch ( SOAPException exception ) { WebServiceSampler . log . warn ( exception . toString ( ) ) ; result . setResponseMessage ( exception . getMessage ( ) ) ; } 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 ( NoClassDefFoundError error ) { WebServiceSampler . log . error ( "Missing<seq2seq4repair_space>class:<seq2seq4repair_space>" , error ) ; result . setResponseMessage ( error . toString ( ) ) ; } catch ( Exception exception ) { if ( "javax.mail.MessagingException" . equals ( exception . getClass ( ) . getName ( ) ) ) { WebServiceSampler . log . warn ( exception . toString ( ) ) ;

Fix:
result . setResponseData ( st . getResponseSOAPContext ( ) . toString ( ) . getBytes ( result . getDataEncodingWithDefault ( ) ) ) ;