2015-01-16 4 views

답변

1

나는 SOAPUI 옵션으로 직접하는 것은 불가능하다고 생각합니다. 그러나 그루비 스크립트로 할 수 있습니다.

groovy testSteptestStep 요청 다음에 추가하여 Dump File에 응답을 저장하십시오. 이 groovy testStep에서 응답을 압축 해제 추적 코드를 추가하고 순서로 Dump File 이름과 디렉토리를 지정하기 위해 동일한 경로 당신의 Dump File, 만했습니다에 결과를 저장 groovy 스크립트는 압축을 해제 할 수 있습니다

import java.io.ByteArrayInputStream 
import java.io.FileOutputStream 
import java.io.IOException 
import java.util.zip.ZipEntry 
import java.util.zip.ZipInputStream 

def buffer = new byte[1024] 

// create the zip input stream from your dump file 
def dumpFilePath = "C:/dumpPath/" 
FileInputStream fis = new FileInputStream(dumpFilePath + "dumpFile.zip") 
def zis = new ZipInputStream(fis) 
def zip = null 

// get each entry on the zip file 
while ((zip = zis.getNextEntry()) != null) { 

    // decompile each entry 
    log.info("Unzip entry here: " + dumpFilePath + zip.getName()) 
    // create the file output stream to write the unziped content 
    def fos = new FileOutputStream(dumpFilePath + zip.getName()) 
    // read the data and write it in the output stream 
    int len; 
    while ((len = zis.read(buffer)) > 0) { 
     fos.write(buffer, 0, len) 
    } 

    // close the output stream 
    fos.close(); 
    // close entry 
    zis.closeEntry() 
} 

// close the zip input stream 
zis.close() 

나는 다시 질문을 읽고 난 당신이 어쩌면 당신이 대신 그루비 코드를 사용할 수없는 압축 해제를 gzip으로 묶인 파일을 풀어야하지 할 것을 깨닫게 :이 도움이

import java.io.ByteArrayInputStream 
import java.io.FileOutputStream 
import java.io.IOException 
import java.util.zip.GZIPInputStream 

def buffer = new byte[1024] 

// create the zip input stream from your dump file 
def dumpFilePath = "C:/dumpPath/" 
FileInputStream fis = new FileInputStream(dumpFilePath + "dumpFile.gz") 
// create the instance to ungzip 
def gzis = new GZIPInputStream(fis) 
// fileOutputStream for the result 
def fos = new FileOutputStream(dumpFilePath + "ungzip") 
// decompress content 
gzis.eachByte(1024){ buf, len -> fos.write(buf,0,len)} 
// close streams 
gzis.close(); 
fos.close(); 

희망,

관련 문제