Designer 10.7 | webMethods Service Development Help | Working with Web Services | Adding Headers to an Operation | Adding a Header to an Operation
 
Adding a Header to an Operation
Keep the following points in mind when adding headers to operations:
*You can copy or move header document types between headers or between faults, but not between a header and a fault. You can use the same document type for a request and a response, subject to the handlers available in the web service descriptor.
*When adding a header element to a provider web service descriptor, be sure that the header does not have the same name as any of the fault elements for that web service descriptor.
*An IS document type used as a header or fault for an operation with a binding style/use of RPC/Encoded cannot contain fields named *body or @attribute fields (fields starting with the “@” symbol).
*You must set up a package dependency if you use an IS document type from a different package as a header.
*A header must have a registered header handler. However, you can add the header to an operation and register a header handler for it later. A header without a handler will be ignored or will cause the request to fail (depending on whether the Must Understand property for the header is set to False or True).
*After a header handler is registered in Integration Server, the IS document types associated with the handler will be listed in the selection dialog box that is displayed when you add a header. For more information about registering handlers, see the Web Services Developer’s Guide.
*The WS Security Handler does not expose supported headers.
*If you add a response header to an operation that uses an In-Only Message Exchange Pattern (MEP), the MEP will change to In-Out MEP. For more information about message exchange patterns, see the Web Services Developer’s Guide.
*You can also add headers to an operation by dragging IS document types from the Package Navigator view to the Operations tab.
*Integration Server considers all of the headers defined in a web service descriptor to be required.
*To add a header to an operation
1. In Package Navigator view, open and lock the web service descriptor to which you want to add a header.
2. In the Operations tab, expand the operation and the request or response to which you want to add the header.
3. Select the header icon and click (Add Header or Fault) on the web service descriptor editor toolbar.
Because a header was selected when you clicked this button, the document selection dialog box displays only those IS document types supported by the header handlers listed in the Handlers tab.
4. Select the IS document type to use as a header. Click OK.
5. Click File > Save.
Important:
When you add a header (or a fault) to a consumer web service descriptor, you must refresh the web service connector(s). See Refreshing a Web Service Connector.