Integration Server 10.5 | Built-In Services Reference Guide | Flow Folder | Summary of Elements in this Folder | pub.flow:setResponseHeader
 
pub.flow:setResponseHeader
WmPublic. Sets a header field in the HTTP response to a calling process (such as a browser or application server) or in the JMS message that contains the SOAP response from a web service invocation.
Input Parameters
fieldName
String Name of the header field to set.
fieldValue
String Value of the header field to set.
Output Parameters
None.
Usage Notes
pub.flow:setResponseHeader sets a single field in the response header. To set multiple response header fields, use pub.flow:setResponseHeaders.
You can use pub.flow:setResponse to set the Content-Type of the HTTP header field. Content-Type specifies the format of the service response. For example, to specify a JSON response, set Content-Type to application/json. For more information about content types Integration Server supports, see the section Accept Header Field in the webMethods Integration Server Administrator’s Guide. Content Handlers for HTTP and FTP Requests.
Important:
If you set the value of the Set-Cookie header and include the SameSite attribute using this or the pub.flow:setResponseHeaders service, then Integration Server ignores the value of the watt.server.http.header.sameSite parameter.
The following HTTP header fields cannot be set by calling this service or by Integration Server applications:
*Allow
*Connection
*Content-Length
*WWW-Authenticate
*Transfer-Encoding
*Upgrade
Note:
Content-Length can be set with the pub.flow:setResponse service.
Keep the following points in mind when adding headers for a JMS message that contains a SOAP response:
*You can specify custom headers.
*You can set some JMS message header fields directly and set others using run-time properties specific to Integration Server.
*You can set JMSType directly. This header name is case-sensitive.
*You can set the following headers indirectly using run-time properties: JMSDeliveryMode, JMSExpiration, and JMSPriority. The following table identifies these properties and indicates the JMS message header fields affected by each property.
Property Name
Description
jms.deliveryMode
Specifies the message delivery mode for the message. Integration Server uses this value to set the JMSDeliveryMode header.
Value
Description
PERSISTENT
Indicates the request message is persistent.
2
Default. Indicates the request message is persistent.
NON_PERSISTENT
Indicates the request message is not persistent.
1
Indicates the request message is not persistent.
Note:
If the jms.deliveryMode is not one of the above values, Integration Server ignores the name/value pair and uses the default value of 2.
jms.timeToLive
Length of time, in milliseconds, that the JMS provider retains the message. A value of 0 means that the message does not expire.
The JMS provider uses this value to set the JMSExpiration header in the sent JMS message.
Note:
If the jms.timeToLivevalue is not a valid Long, Integration Server ignores the property and uses the default value of 0.
jms.priority
Specifies the message priority. The JMS standard defines priority levels from 0 to 9, with 0 as the lowest priority and 9 as the highest.
Integration Server uses this value to set the JMSPriority header.
If the jms.priority value is not a value between 0 to 9, Integration Server ignores the property and uses the default value of 4.
*You can specify the following JMS-defined properties:
*JMSXGroupID
*JMSXGroupSeq
If the value of JMSXGroupSeq is not an String that contains a number, Integration Server ignores the name/value pair and does not place it in the message header.
Note:
The JMSXGroupID and JMSXGroupSeq names are case-sensitive.
*You can set any provider-specific property whose name starts with “JMS_” in fieldName. Because the JMS standard reserves the prefix “JMS_<vendor_name>” for provider-specific properties, Integration Server does not validate the name or value of this content.
Note:
The JMS provider determines which provider-specific properties to accept and include in the JMS message properties. For more information about provider-specific message properties how the JMS provider handles them, review the JMS provider documentation.
*The lowercase “jms.” prefix is reserved for run-time properties used by Integration Server. If a header starts with “jms.” and is not one of the “jms.” properties defined by Integration Server, Integration Server ignores the property.
*The “JMSX” prefix is reserved for JMS-defined properties. If a header whose name starts with “JMSX” is passed into fieldName and it is not named JMSXGroupID or JMSXGroupSeq, Integration Server throws a ServiceException.
*You cannot set any of the SOAP over JMS message header properties. These header names start with “SOAPJMS”.