【发布时间】:2015-06-23 07:20:27
【问题描述】:
我正在使用 Soap UI 基本版本进行一些模拟。我需要将我的请求保存到某个文件中。我刚刚生成了带有一些预定义输入到输出规则的模拟服务,我在网上搜索并找到了这个:
def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea( "http log" );
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
Date startTime = new Date();
def cur_Time = startTime.getMonth() + "_" + startTime.getDate()
cur_Time = cur_Time + "_" + startTime.getHours() + "_" + startTime.getMinutes() +startTime.getSeconds()
def testPath = "C:/Users/..." + cur_Time + ".log"
def logFile = new File(testPath)
logFile.write("soapUI Logs In a file.\r\n")
if( logArea !=null )
{
def model = logArea.model
if( model.size > 0 )
for( c in 0..(model.size-1) )
logFile.append("\n" + model.getElementAt( c ))
}
logArea.clear()
这只能从 Soap UI GUI 请求调用中正常工作。即使我从外部服务调用这个模拟服务,我怎样才能坚持我的请求?
我没有任何测试用例,也不需要保存来自它们的请求,只需要直接来自外部系统的请求。
谢谢!
【问题讨论】:
标签: web-services soap request soapui