user3878134
user3878134

Reputation: 3

unexpected token while reading xml to string in JSR223 sampler

I'm trying to read a string which has XML and facing an unexpected token issue.

I'm using a JSR223 Sampler in JMeter and trying to read value by using

request_payload=vars.get("${requestPayload}");

I have my xml in variable requestPayload= "<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header><wsse:Security "

I want to read this value in JSR223 Sampler.

The error message:

Response message: javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script4.groovy: 1: unexpected token: http @ line 1, column 54. t("<soap:Envelope xmlns:soap="http://www

Upvotes: 0

Views: 773

Answers (2)

SAIR
SAIR

Reputation: 499

Correct syntax to overcome the error is given below:

vars.get("requestPayload");

enter image description here

enter image description here

enter image description here

Upvotes: 0

Ori Marko
Ori Marko

Reputation: 58772

Don't use ${} syntax in JSR223, Simply

  vars.get("requestPayload");

Upvotes: 0

Related Questions