Here you can find the source of addMessageHandler(Object binding, SOAPHandler
Parameter | Description |
---|---|
binding | binding to which we'll add the handler |
handler | the handler to be added |
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void addMessageHandler(Object binding, SOAPHandler<SOAPMessageContext> handler)
//package com.java2s; /*//from w w w .jav a2 s.c o m Copyright 2012 VU Medical Center Amsterdam Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import java.util.ArrayList; import java.util.List; import javax.xml.ws.Binding; import javax.xml.ws.BindingProvider; import javax.xml.ws.handler.LogicalHandler; import javax.xml.ws.handler.soap.SOAPHandler; import javax.xml.ws.handler.soap.SOAPMessageContext; public class Main { /** * Add a message handler to a SOAP binding * @param binding binding to which we'll add the handler * @param handler the handler to be added */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static void addMessageHandler(Object binding, SOAPHandler<SOAPMessageContext> handler) { final Binding b = ((BindingProvider) binding).getBinding(); List handlerList = b.getHandlerChain(); if (handlerList == null) handlerList = new ArrayList(); handlerList.add(handler); b.setHandlerChain(handlerList); } /** * Add a message handler to a SOAP binding * @param binding binding to which we'll add the handler * @param handler the handler to be added */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static void addMessageHandler(Object binding, LogicalHandler handler) { final Binding b = ((BindingProvider) binding).getBinding(); List handlerList = b.getHandlerChain(); if (handlerList == null) handlerList = new ArrayList(); handlerList.add(handler); b.setHandlerChain(handlerList); } /** * Add a message handler to a SOAP binding * @param binding binding to which we'll add the handler * @param index position in the list of handlers * @param handler the handler to be added */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static void addMessageHandler(Object binding, int index, SOAPHandler<SOAPMessageContext> handler) { final Binding b = ((BindingProvider) binding).getBinding(); List handlerList = b.getHandlerChain(); if (handlerList == null) handlerList = new ArrayList(); handlerList.add(index, handler); b.setHandlerChain(handlerList); } /** * Add a message handler to a SOAP binding * @param binding binding to which we'll add the handler * @param index position in the list of handlers * @param handler the handler to be added */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static void addMessageHandler(Object binding, int index, LogicalHandler handler) { final Binding b = ((BindingProvider) binding).getBinding(); List handlerList = b.getHandlerChain(); if (handlerList == null) handlerList = new ArrayList(); handlerList.add(index, handler); b.setHandlerChain(handlerList); } }