title: How can I put an an EDIFACT message (containing multiple special characters and multiple lines) in a variable using groovy?
body: <p>I have an EDIFACT message, which looks something like this:</p>
  <pre><code>AAA:+.? '
  ABC+ABCD:1+ABCDEFG:ZZ+ABCDEF:ZZ+123456:2042+12345678901++ABCD'
  DEF+ABCD+LH+FVKJUB+20000:2042+Y1234567+UN+D:21B'
  GHI+1+ABCD:D:11A:AA:ABCD+ABCD12345678901123ABC123456'
  JKL+745'
  HHH+TN:IIAA891011213531235BNM422244:::001'
  CCC+NT+++ABCDEFGHIJKLMNOPQRS'
  STU+00123456789012:UF+0000000000:GY'
  VXY+50+MI1234+++MI'
  AAA+235+ABC'
  BBB+200:3202062000:301'
  FFF+90+USA'
  BBB+232:2101051135:201'
  CCC+FF+++AaBaBa001:TEST1'
  DDD+3++G'
  EEE+329:711013'
  FFF+178+XXX'
  FFF+179+YYY'
  GGG+2+ZZZ'
  HHH+BXG:ABCDEF'
  HHH+ABC:12AB3E01234E8UD8'
  III+P:110:111+100000001'
  EEE+36:281105'
  FFF+91+ASD'
  VVV+50:2'
  XXX+0011+1'
  YYY+1+U0123456'
  ZZZ+1+U1234560002'
  </code></pre>
  <p>Using a Jmeter JSR223 Sampler, I need to send it as a payload to an IBM MQ message queue.</p>
  <p>I am trying to put this message in a variable so that I can pass it around, but I am getting errors because of all the special characters it contains.</p>
  <pre><code>def sessInboundQueue = System.getProperties().get(&quot;SessionInbound&quot;)
  def destinationInboundQueue = System.getProperties().get(&quot;DestinationInbound&quot;)
  def producer = sessInboundQueue.createProducer(destinationInboundQueue) 
  
  def payload = &quot;AAA:+.? '
  ABC+ABCD:1+ABCDEFG:ZZ+ABCDEF:ZZ+123456:2042+12345678901++ABCD'
  DEF+ABCD+LH+FVKJUB+20000:2042+Y1234567+UN+D:21B'
  GHI+1+ABCD:D:11A:AA:ABCD+ABCD12345678901123ABC123456'
  JKL+745'
  HHH+TN:IIAA891011213531235BNM422244:::001'
  CCC+NT+++ABCDEFGHIJKLMNOPQRS'
  STU+00123456789012:UF+0000000000:GY'
  VXY+50+MI1234+++MI'
  AAA+235+ABC'
  BBB+200:3202062000:301'
  FFF+90+USA'
  BBB+232:2101051135:201'
  CCC+FF+++AaBaBa001:TEST1'
  DDD+3++G'
  EEE+329:711013'
  FFF+178+XXX'
  FFF+179+YYY'
  GGG+2+ZZZ'
  HHH+BXG:ABCDEF'
  HHH+ABC:12AB3E01234E8UD8'
  III+P:110:111+100000001'
  EEE+36:281105'
  FFF+91+ASD'
  VVV+50:2'
  XXX+0011+1'
  YYY+1+U0123456'
  ZZZ+1+U1234560002'&quot;
  def msg = sessInboundQueue.createTextMessage(payload)
  </code></pre>
  <p>This is the error:</p>
  <pre><code>    Script87.groovy: 9: Unexpected input: '&quot;' @ line 9, column 15.
     def payload = &quot;AAA:+.? '
  </code></pre>