title: Passing token from get request to a header in SoapUI
body: <p>I have a <code>getToken</code> request in a test case <code>get_Admin_Token</code> in <code>PassToken</code> test suite, where I have as a response following JSON:</p>
  
  <pre><code>{
     "access_token": "5701f536-0bd5-441f-a490-21aafeasdasdd",
     "token_type": "bearer",
     "refresh_token": "c53af657-8292-4aff-xxxx-xxxf0ffed310",
     "expires_in": 80208,
     "scope": "read write trust"
  }
  </code></pre>
  
  <p>I need to use <code>access_token</code> value in <code>uploadFile</code> method, but I need to pass it in a header. I have a field <code>Authorization</code> with <code>Bearer: $(access_token)</code> value.</p>
  
  <p>Using some google I found:
  <a href="https://community.smartbear.com/t5/SoapUI-Open-Source/How-do-I-do-a-property-transfer-with-multiple-source-responses/td-p/106456" rel="nofollow noreferrer">https://community.smartbear.com/t5/SoapUI-Open-Source/How-do-I-do-a-property-transfer-with-multiple-source-responses/td-p/106456</a> question, which was looking similar. I started to create a GroovyScript test step, where I used code to pass it to the Properties table, but no success. I was also trying to put it to assertions for the <code>get_Admin_Token</code>, but I got a message about incorrect object types. I also tried to use <code>def accessToken = jsonSlurper.access_token.toString()</code> to use strings, but now I got an error `</p>
  
  <pre><code>No signature of method: 
  com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.setProperty() is 
  applicable for argument types: (java.lang.String, java.lang.String) values: 
  [AUTH_KEY, Bearer 5701f536-0bd5-441f-a490-21aafeasdasdd] Possible solutions: 
  getProperty(java.lang.String), addProperty(java.lang.String), 
  hasProperty(java.lang.String), hasProperty(java.lang.String), getProject(), 
  getProperties()
  </code></pre>
  
  <p>My groovy code:</p>
  
  <pre><code>import groovy.json.JsonSlurper
  def response = messageExchange.response.responseContent
  def jsonSlurper = new JsonSlurper().parseText(response)
  assert !(jsonSlurper.isEmpty())
  def accessToken = jsonSlurper.access_token.toString()
  assert null != accessToken, "access_token does not have a value"
  def authorizationKey = "${accessToken}"
  context.testCase.setProperty('AUTH_KEY',"Bearer " + authorizationKey)
  </code></pre>
  
  <p>Is this code valid? I'm not sure what to put in next method as authorization value in header, I tried with <code>${#get_Admin_Token#AUTH_KEY}</code>, but it doesn't work</p>