Contributions
Parse REST request in Mock Response?
I am trying to parse a rest request in a Mock Response. The request looks something like: http://server/item1/{item1}/item2/{item2} The SoapUI documentation for MockService Scripting looks like it only covers parsing SOAP XML requests, e.g.: def groovyUtils = new com.eviware.soapui.support.GroovyUtils (context) def holder = groovyUtils.getXMLHolder( mockRequest.requestContent ) def item1 = holder.getNodeValue("//item1") However, the REST request doesn't come in as XML, so the above doesn't work. Right now I'm using: def item1 = mockRequest.getPath().tokenize('/')[1] def item2 = mockRequest.getPath().tokenize('/')[3] Is there a better way to do this? Perhaps by calling something like: def item1 = mockRequest.getProperty("item1") Or something like that?1.2KViews0likes1CommentCan I add a JSON assertion for a service that is currently returning XML?
I have a broken web service that is returning XML data. If it was working, it would return JSON data. Currently I am unable to add a JsonPath Count assertion. I am guessing this is because the data returned when I ran the test step is XML. Is there a way to enable this assertion?663Views0likes1Comment