addSOAPResponseHeader

Adds a SOAP response header to a web service response. Call only from within a CFC web service function that is processing a request as a SOAP web service.

addSOAPResponseHeader(namespace, name, value [, mustunderstand]) → returns boolean

addSOAPResponseHeader Argument Reference

namespace string
Required

A webservice object as returned from the cfobject tag or the createobject function

name string
Required

Name of the SOAP header

value string
Required

Value of the SOAP header

mustunderstand boolean

The mustUnderstand attribute indicates whether processing of the header is optional or mandatory.
This basically translates to the node trying to find an appropriate handler that matches the header
and proceed with processing the message in a manner consistent with its specification. If it can't find an appropriate handler
it must return an error and stop further processing. If mustUnderstand is set to true
the node is not allowed to ignore it.

Examples sample code invoking the addSOAPResponseHeader function


Set the username header as a string and get the first header as an object (string) and as XML

ws = createObject("webservice", "http://localhost/soapheaders/headerservice.cfc?WSDL");
addSOAPRequestHeader(ws, "http://mynamespace/", "username", "tom", false);
ret = ws.echo_me("argument");
header = getSOAPResponseHeader(ws, "http://www.tomj.org/myns", "returnheader"); 
XMLheader = getSOAPResponseHeader(ws, "http://www.tomj.org/myns", "returnheader", true);

Fork me on GitHub