mBlox__Inc__Sup
14 years agoNew Contributor
[Resolved] Problems with MockService AfterRequest script
Hi,
I do have a basic MockService, generated directly on import of the WSDL.
When i run it, and send a request to it, it works fine.
As soon as i add the below code to the AfterRequest Script, A java exception is thrown and the return response to the requestor is a HTTP 500 error.
the code is:
Even with all of it commented out (other than the log.info) it throws the error which looks like this:
note that the content shows up as some binary string, rather than the xml that i was expecting.
Am i doing something stupid wrong? or is this a bug of some sort.
To be complete, soapUI 4.0.0 and 3.6.1 both show this behavior.
Any help would be appreciated.
cheers,
m
I do have a basic MockService, generated directly on import of the WSDL.
When i run it, and send a request to it, it works fine.
As soon as i add the below code to the AfterRequest Script, A java exception is thrown and the return response to the requestor is a HTTP 500 error.
the code is:
log.info mockRequest.requestContent
//def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent)
//def transactionid = (String)( holder["//transactionId"])
//def transactionStatus = (String) (holder["//statusCode"])
//def transactiondescription = (String) (holder["//statusDesc"])
//def date = (String) new Date()
//file = new File("receivedLog.txt")
//file.write(date + "," + transactionid + "," + mockRequest.getSoapAction() + "," + transactionStatus + "," + transactiondescription + "\n")
//log.info (date + "," + transactionid + "," + mockRequest.getSoapAction() + "," + transactionStatus + "," + transactiondescription + "\n")
Even with all of it commented out (other than the log.info) it throws the error which looks like this:
HTTP/1.1 500 Internal Server Error
Server: Jetty(6.1.x)
‹
note that the content shows up as some binary string, rather than the xml that i was expecting.
Am i doing something stupid wrong? or is this a bug of some sort.
To be complete, soapUI 4.0.0 and 3.6.1 both show this behavior.
Any help would be appreciated.
cheers,
m