本文整理汇总了Java中javax.xml.ws.handler.soap.SOAPHandler类的典型用法代码示例。如果您正苦于以下问题:Java SOAPHandler类的具体用法?Java SOAPHandler怎么用?Java SOAPHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SOAPHandler类属于javax.xml.ws.handler.soap包,在下文中一共展示了SOAPHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerUnderstoodHeaders
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
private void registerUnderstoodHeaders(MessageContext request,
List<Handler> handlerList) {
if (handlerList != null && handlerList.size() > 0) {
Set<QName> understoodHeaders = new HashSet<QName>();
// Add the headers from each of the SOAP handlers to the collection
for (Handler handler : handlerList) {
if(handler instanceof SOAPHandler){
SOAPHandler soapHandler = (SOAPHandler)handler;
Set<QName> headers = soapHandler.getHeaders();
if (headers != null && headers.size() > 0) {
understoodHeaders.addAll(headers);
}
}
}
// Put the understood header qnames on the request context where it can
// be found during response processing.
if (understoodHeaders != null && understoodHeaders.size() > 0) {
if (log.isDebugEnabled()) {
log.debug("Adding understood header QName collection to message context " + understoodHeaders);
}
request.setProperty("client.UnderstoodHeaders", understoodHeaders);
}
}
}
示例2: setUpHandlersOnce
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
private void setUpHandlersOnce() {
handlers = new ArrayList<Handler>();
HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
if (!soapSnapShot.isEmpty()) {
handlers.addAll(soapSnapShot);
roles = new HashSet<String>();
roles.addAll(handlerConfig.getRoles());
}
}
示例3: setUpProcessor
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
void setUpProcessor() {
if (handlers == null) {
// Take a snapshot, User may change chain after invocation, Same chain
// should be used for the entire MEP
handlers = new ArrayList<Handler>();
HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
if (!soapSnapShot.isEmpty()) {
handlers.addAll(soapSnapShot);
roles = new HashSet<String>();
roles.addAll(handlerConfig.getRoles());
processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
}
}
}
示例4: addMessageHandler
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
/**
* 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);
}
示例5: setHandlerChain
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
@Override
public void setHandlerChain(List<Handler> list) {
if (list != null) {
for (Handler handler : list) {
if (handler instanceof SOAPHandler) {
throw new WebServiceException("Chain contains incompatibile handler");
}
}
}
super.setHandlerChain(list);
}
示例6: sortChain
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
private void sortChain() throws WebServiceException {
if (handlers.size() == 0) {
logicalLength = 0;
return;
}
ArrayList<Handler> logicalHandlers = new ArrayList<Handler>();
ArrayList<Handler> protocolHandlers = new ArrayList<Handler>();
Iterator handlerIterator = handlers.iterator();
while (handlerIterator.hasNext()) {
// this is a safe cast since the handlerResolver and binding.setHandlerChain
// and InvocationContext.setHandlerChain verifies it before we get here
Handler handler = (Handler)handlerIterator.next();
// JAXWS 9.2.1.2 sort them by Logical, then SOAP
if (LogicalHandler.class.isAssignableFrom(handler.getClass()))
logicalHandlers.add((LogicalHandler) handler);
else if (SOAPHandler.class.isAssignableFrom(handler.getClass()))
// instanceof ProtocolHandler
protocolHandlers.add((SOAPHandler) handler);
else if (Handler.class.isAssignableFrom(handler.getClass())) {
throw ExceptionFactory.makeWebServiceException(Messages
.getMessage("handlerChainErr1", handler.getClass().getName()));
} else {
throw ExceptionFactory.makeWebServiceException(Messages
.getMessage("handlerChainErr2", handler.getClass().getName()));
}
}
logicalLength = logicalHandlers.size();
// JAXWS 9.2.1.2 sort them by Logical, then SOAP
handlers.clear();
handlers.addAll(logicalHandlers);
handlers.addAll(protocolHandlers);
}
示例7: registerSOAPHandlerHeaders
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
/**
* registerHandlerHeaders will invoke getHeaders on SOAPHandlers and return a List of headers
* that are Understood by the handlers.
* @param msgContext
* @param handlers
*/
public static List<QName> registerSOAPHandlerHeaders(MessageContext msgContext, List<Handler> handlers){
List<QName> understood = new ArrayList<QName>();
if(msgContext == null){
return understood;
}
for(Handler handler:handlers){
if(handler instanceof SOAPHandler){
SOAPHandler soapHandler = (SOAPHandler)handler;
//Invoking getHeaders.
if(log.isDebugEnabled()){
log.debug("Invoking getHeader() on SOAPHandler");
}
Set<QName> headers = soapHandler.getHeaders();
if(headers!=null){
for(QName header:headers){
if(!understood.contains(header)){
if(log.isDebugEnabled()){
log.debug("Adding Header QName" + header + " to uderstoodHeaderQName List");
}
//Adding this to understood header list.
understood.add(header);
}
}
}
}
}
return understood;
}
示例8: registerHandlerHeaders
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
public static void registerHandlerHeaders(AxisService axisService, List<Handler> handlers) {
if (handlers == null || axisService == null) {
return;
}
ArrayList<QName> understoodHeaderQNames = new ArrayList<QName>();
for (Handler handler : handlers) {
if (handler instanceof SOAPHandler) {
SOAPHandler soapHandler = (SOAPHandler) handler;
Set<QName> headers = soapHandler.getHeaders();
if (headers != null) {
for (QName header : headers) {
if (!understoodHeaderQNames.contains(header)) {
understoodHeaderQNames.add(header);
}
}
}
}
}
if (!understoodHeaderQNames.isEmpty()) {
Parameter headerQNParameter =
new Parameter(EndpointDescription.HANDLER_PARAMETER_QNAMES, understoodHeaderQNames);
try {
axisService.addParameter(headerQNParameter);
} catch (AxisFault e) {
log.warn(Messages.getMessage("regHandlerHeadersErr",axisService.getName(),e.getMessage()));
}
}
}
示例9: add
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
@Override
public TraceeClientHandlerResolverBuilder add(SOAPHandler<SOAPMessageContext> handler) {
if (handler != null) {
this.handlerList.add(handler);
}
return this;
}
示例10: shouldCreateHandlerResolverAndIgnoreNullValuedHandlerInstance
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
@Test
public void shouldCreateHandlerResolverAndIgnoreNullValuedHandlerInstance() {
HandlerResolver handlerResolver = TraceeClientHandlerResolver.buildHandlerResolver().add((SOAPHandler)null).build();
MatcherAssert.assertThat(handlerResolver, Matchers.notNullValue());
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo), Matchers.notNullValue());
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo).size(), Matchers.is(1));
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo).get(0).getClass(),
Matchers.typeCompatibleWith(TraceeClientErrorLoggingHandler.class));
}
示例11: shouldCreateHandlerResolverAndIgnoreNullValuedHandlerType
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
@Test
public void shouldCreateHandlerResolverAndIgnoreNullValuedHandlerType() {
HandlerResolver handlerResolver = TraceeClientHandlerResolver.buildHandlerResolver().add((Class<SOAPHandler<SOAPMessageContext>>)null).build();
MatcherAssert.assertThat(handlerResolver, Matchers.notNullValue());
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo), Matchers.notNullValue());
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo).size(), Matchers.is(1));
MatcherAssert.assertThat(handlerResolver.getHandlerChain(portInfo).get(0).getClass(),
Matchers.typeCompatibleWith(TraceeClientErrorLoggingHandler.class));
}
示例12: setUpHandlersOnce
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
private void setUpHandlersOnce() {
handlers = new ArrayList<Handler>();
HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
if (!soapSnapShot.isEmpty()) {
handlers.addAll(soapSnapShot);
roles = new HashSet<String>();
roles.addAll(handlerConfig.getRoles());
}
}
示例13: setUpProcessor
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
void setUpProcessor() {
// Take a snapshot, User may change chain after invocation, Same chain
// should be used for the entire MEP
handlers = new ArrayList<Handler>();
HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
if (!soapSnapShot.isEmpty()) {
handlers.addAll(soapSnapShot);
roles = new HashSet<String>();
roles.addAll(handlerConfig.getRoles());
processor = new SOAPHandlerProcessor(true, this, binding, handlers);
}
}
示例14: getSoapHandlers
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
public List<SOAPHandler> getSoapHandlers() {
return soapHandlers;
}
示例15: SOAPConfigDelegateHandler
import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
public SOAPConfigDelegateHandler(SOAPHandler<T> delegate, boolean isPre) {
super(delegate, isPre);
}