Contact Free trial Login

To Set a SOAP Header

In this procedure, you add header information to the outbound response that complies with the WSDL. Header information that complies with the WSDL document is called APIUsageInformation.

  1. In Studio, open the tshirt2.wsdl in src/main/wsdl and scroll to APIUsageInformation element, which is the element expected by the contract. Copy the name of the element to the clipboard.

  2. On the canvas, select Transform message in the OrderTshirt:/TshirtService/TshirtServicePort/api-config flow, and in the properties editor, click Add New Target:

    apikit for soap 3005f
  3. Select Property instead of Variable from the drop-down.

  4. In Variable Name, paste the contents of the clipboard, and add soap. as a prefix. or type soap.APIUsageInformation.

    The complete variable name looks like this:


  5. Click OK.

  6. Double-click apiCallsRemaining: Integer.

    apikit for soap 41732

    Double-clicking apiCallsRemaining: Integer adds APIUsageInformation: { apiCallsRemaining: null } to the DataWeave code for the outbound property:

    %dw 1.0
    %output application/xml
    %namespace ns0
      ns0#APIUsageInformation: {
        apiCallsRemaining: null
  7. Change null to 10.

  8. Save and rerun the project.

  9. In the SoapUI, execute the OrderTshirt request again. The response envelope from APIkit for SOAP is:

    <soap:Envelope xmlns:soap="">
          <ns0:APIUsageInformation xmlns:ns0="">
          <ns0:OrderTshirtResponse xmlns:ns0="">
             <orderId>I got a request from John, using the following auth header 987654321</orderId>