Contributions
Re: How to setRequestContent in Mock in OnRequest Script to replace first character (is it a BUG??)
This code works well. Problem was in my script that I call at mock response. You can use this code to convert UTF-8-BOM request to UTF-8 without BOM. def mockRequestContent try { mockRequestContent = mockRequest.getRequestContent() mockRequest.setRequestContent(mockRequestContent.substring(1)) } catch (Exception e) { log.info(e) }1.8KViews1like0CommentsHow to setRequestContent in Mock in OnRequest Script to replace first character (is it a BUG??)
Hey there! I'm trying to setRequestContent. I have this code in "OnRequest Script" in my Mock: def mockRequestContent try { mockRequestContent = mockRequest.getRequestContent() mockRequest.setRequestContent(mockRequestContent) } catch (Exception e) { log.info(e) } When I send a response to my Mock, I don't get errors at tab "script log", but I get an error at "error log" (see it in attachment). What is the right way to set request content? Thx for your answers.Solved1.9KViews0likes2CommentsRe: How to setRequestContent in Mock in OnRequest Script to replace first character (is it a BUG??)
Look at my stacktrace. Is it a bug of SoupUI? Why does error have curly brackets around Exception e in the stacktrace - } catch {Exception e} {? Mon Mar 06 19:02:26 MSK 2017:ERROR:org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script25.groovy: 97: unexpected token: catch @ line 97, column 4. } catch {Exception e} { ^ org.codehaus.groovy.syntax.SyntaxException: unexpected token: catch @ line 97, column 4.1.8KViews0likes1Comment