Forum Discussion

pvl's avatar
pvl
Occasional Contributor
7 years ago

IOException: Decompression of response failed when writing response of mockservice

Im using the soapuitestcaserunner to run some of my soapui tests.

For that i use the following code:

		SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

		runner.setProjectFile("xml/" + arg1 + ".xml");
		runner.getAssertionResults();
		runner.setPrintReport(true);
		runner.run();

Now i also wanna test one of my mock requests that has the following assertion:

 

def timestamp = System.currentTimeMillis()
def directory = "SoapUi\\test"

def requestFile = new File(directory, "request_${timestamp}.txt")
requestFile.append( context.expand('${ConversionRate#Request}') )

def responseFile = new File(directory, "response_${timestamp}.txt")
responseFile.append( context.expand('${ConversionRate#Response}') )

But when i try and run this test it generates the request file fine but the responseFile looks all weird and i get the following error in my logs:

16:35:32,683 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
16:35:32,683 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /mockCurrencyConvertorSoap12 HTTP/1.1
16:35:32,693 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
16:35:32,697 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
java.io.IOException: Decompression of response failed
	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport.getResponseBody(HttpMethodSupport.java:264)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods.ExtendedPostMethod.getResponseBody(ExtendedPostMethod.java:116)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.BaseHttpResponse.<init>(BaseHttpResponse.java:85)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.SinglePartHttpResponse.<init>(SinglePartHttpResponse.java:44)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.WsdlSinglePartHttpResponse.<init>(WsdlSinglePartHttpResponse.java:37)
	at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.wsdlRequest(HttpPackagingResponseFilter.java:70)
	at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.afterAbstractHttpResponse(HttpPackagingResponseFilter.java:49)
	at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.afterRequest(AbstractRequestFilter.java:64)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:272)
	at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
	at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:79)
	at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:217)
	at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:364)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.apache.http.protocol.HttpCoreContext.getAttribute(HttpCoreContext.java:102)
	at org.apache.http.protocol.HttpCoreContext.getAttribute(HttpCoreContext.java:117)
	at org.apache.http.client.protocol.HttpClientContext.getRequestConfig(HttpClientContext.java:239)
	at org.apache.http.client.protocol.ResponseContentEncoding.process(ResponseContentEncoding.java:130)
	at com.eviware.soapui.impl.wsdl.support.CompressionSupport.decompress(CompressionSupport.java:86)
	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport.getResponseBody(HttpMethodSupport.java:262)

 When i run the mockservice from soapui itself it generates both files without issue with the correct content

Can anyone help me figure out what the problem is?

2 Replies

  • pvl's avatar
    pvl
    Occasional Contributor

    If the information given is not clear or if you need more information please let me know so i can provide it.

    • pvl's avatar
      pvl
      Occasional Contributor

      found the solution, I had to add:

       

      SoapUI.getSettings().setBoolean(HttpSettings.RESPONSE_COMPRESSION, false);

      to the testcaserunner