header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
January 09, 2009, 06:23:24 am
Username: Password:
Login with username, password and session length

Forgot your password?
 
log response message in listener
Welcome, Guest. Please login or register.
January 09, 2009, 06:23:24 am
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  log response message in listener
« previous next »
Pages: [1] Print
Author Topic: log response message in listener  (Read 483 times)
Toby Hage
Newbie
*
Posts: 13


« on: July 25, 2008, 12:06:11 pm »

Hello,

Have searched the forum and read the manual but couldn't find this.
i'am trying to log the response from a webservice in a listener, but don't know which object to use.

I have the following

Code:
public synchronized void afterTestStep(LoadTestRunner runner,LoadTestRunContext context, TestRunner testRunner,TestRunContext testContext, TestStepResult result)
{

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder(xxx.responseContent )
                def faulstring = holder["string(//faultstring)"]
                writer.writeLine(faulstring)
        }

which object to use on the pace of the xxx???

thanx in advance
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #1 on: July 25, 2008, 03:56:48 pm »

Hi Toby,

try implementing the SubmitListener interface instead, and implement the afterSubmit method to get the response from the available Submit object..

makes sense?

regards!

/Ole
eviware.com
Logged
Toby Hage
Newbie
*
Posts: 13


« Reply #2 on: July 25, 2008, 04:40:07 pm »

Hi Ole,

That makes sense. But I think not in this situation. I'll think :-)

Because I want to log also things from the afterTestStep method and want everything in one file and one line.

Is is possible to retrieve response from the afterTestStep method?

regards,

Toby.
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #3 on: July 25, 2008, 10:30:30 pm »

Hi,

ah, sure.. what you can do is cast the TestStepResult to a WsdlTestRequestStepResult, which has a getResponseContent method, so in your code you should be able to replace "xxx" with "result".. !?

regards,

/Ole
eviware.com
Logged
Toby Hage
Newbie
*
Posts: 13


« Reply #4 on: July 26, 2008, 10:40:57 am »

Works perfect!

Thank you.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header