Skip to main content

Groovy Script

Explanation

This script performs the following operations:
  1. XML Parse: XML data coming from request body is parsed
  2. Header Check: Checks if SOAP Header field exists, creates if not
  3. Username Retrieval: Username information from authentication is retrieved
  4. Adding to Header: Username information is added to Header field
  5. Sending to Backend: Updated XML is sent to backend
This script should be run on the request line (Request Policy) because it uses the requestBodyTextFromClient and requestBodyTextToTargetAPI variables.