---
schema_version: "1"
id: ea1991f85e73a6ad97da30efaec7eaef23375763531dbed0ce0cbb834f41d7ee
title: Get a SOAP Header
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/apikit/latest/apikit-4-get-header-task.md
canonical_url: https://docs.mulesoft.com/apikit/latest/apikit-4-get-header-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a2dfc03f55181cd85f74472266af19261f3ed03d97aa875f6b2d328c3865dbf2
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
---
product: APIkit
version: 4.x
is-latest-version: true
---

# Get a SOAP Header

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Retrieve a SOAP header value from an incoming request when you exercise APIs with SoapUI and
Anypoint Studio. This walkthrough reads the API key from the `OrderTshirt` envelope and surfaces it
through DataWeave in the `OrderTshirt:\soapkit-config` flow. You update Transform Message, rerun the
app, and confirm the header appears in the response.

![Request window showing the SOAP envelope header](/mulesoft/current/en-us/apikit/latest/_images/apikit-for-soap-53dc2.png)

1.  In SoapUI, modify the `OrderTshirt` request by entering a value for the API key.

    For example, enter `987654321` between the `<apiKey>` tags.

2.  In Studio, in the `OrderTshirt:\soapkit-config` flow, select **Transform Message**.

3.  Edit the DataWeave code to get the API key, which is a header property:

    ```raml
    %dw 2.0
    output application/java
    ns ns0 http://mulesoft.org/tshirt-service
    ---
    {
          body : {
             ns0#OrderTshirtResponse: {
               orderId: "I got a request from "
               ++ payload.body.ns0#OrderTshirt.name
               ++ " using the following auth header "
               ++ (payload.headers["AuthenticationHeader"].ns0#AuthenticationHeader.apiKey default "")
            }
        } write "application/xml"
    }
    ```

4.  Save and run the project again.

5.  In SoapUI, send a request to the `OrderTshirt` endpoint. + The following response appears:

    ```xml
       <soap:Body>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          <ns0:OrderTshirtResponse xmlns:ns0="http://mulesoft.org/tshirt-service">
             <orderId>I got a request from John, using the following auth header 987654321</orderId>
          </ns0:OrderTshirtResponse>
       </soap:Body>
    </soap:Envelope>
    ```

## See Also

- [Set a SOAP Header](https://docs.mulesoft.com/apikit/latest/apikit-4-set-header-task)
