3.4.2. 处理程序链
每个端点配置都可以与 PRE
或 POST
处理程序链关联。每一处理程序链可能包含 JAX-WS 兼容处理程序,对消息执行其他处理。对于出站消息,PRE
处理程序链处理程序先执行,然后执行使用标准 JAX-WS 附加到端点的任何处理程序之前,如 @HandlerChain
注释。POST
处理程序链处理程序在常规端点处理程序后执行。对于入站消息,反之亦然。
服务器出站消息
Endpoint --> PRE Handlers --> Endpoint Handlers --> POST Handlers --> ... --> Client
服务器入站消息
Client --> ... --> POST Handlers --> Endpoint Handlers --> PRE Handlers --> Endpoint
添加处理程序链
您可以使用以下管理 CLI 命令将 POST
处理程序链添加到端点配置中:
/subsystem=webservices/endpoint-config=My-Endpoint-Config/post-handler-chain=my-post-handler-chain:add
您可以使用以下管理 CLI 命令将 PRE
处理程序链添加到端点配置中:
/subsystem=webservices/endpoint-config=My-Endpoint-Config/pre-handler-chain=my-pre-handler-chain:add
配置处理程序链
使用 protocol-bindings
属性设置触发处理程序链启动的协议。
/subsystem=webservices/endpoint-config=My-Endpoint-Config/post-handler-chain=my-post-handler-chain:write-attribute(name=protocol-bindings,value=##SOAP11_HTTP)
如需有关为处理程序链配置处理程序的信息,请参见 handlers 部分。
删除处理程序链
您可以使用管理 CLI 删除处理程序链。
/subsystem=webservices/endpoint-config=My-Endpoint-Config/post-handler-chain=my-post-handler-chain:remove