Contact Free trial Login

To Set a SOAP Header

In this procedure, you add header information to the 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/resources/api 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:/soapkit-config flow, and in the properties editor, click Add New Target:

    apikit for soap 3005f
  3. Select 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. In Output, double-click apiCallsRemaining: Integer.

    apikit for soap 41732

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

    %dw 2.0
    output application/java
      "soap.APIUsageInformation": 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>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.