当前位置: 首页>>代码示例>>Java>>正文


Java SOAPHandler类代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:InvocationControllerImpl.java

示例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());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ServerSOAPHandlerTube.java

示例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);
            }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:ClientSOAPHandlerTube.java

示例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);
}
 
开发者ID:ddRPB,项目名称:rpb,代码行数:15,代码来源:Util.java

示例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);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:12,代码来源:HTTPBinding.java

示例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);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:39,代码来源:HandlerChainProcessor.java

示例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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:HandlerUtils.java

示例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()));
        }
    }  
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:32,代码来源:DescriptionUtils.java

示例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;
}
 
开发者ID:tracee,项目名称:contextlogger,代码行数:10,代码来源:TraceeClientHandlerResolver.java

示例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));

}
 
开发者ID:tracee,项目名称:contextlogger,代码行数:13,代码来源:TraceeClientHandlerResolverTest.java

示例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));

}
 
开发者ID:tracee,项目名称:contextlogger,代码行数:13,代码来源:TraceeClientHandlerResolverTest.java

示例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());
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:11,代码来源:ServerSOAPHandlerTube.java

示例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);
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:14,代码来源:ClientSOAPHandlerTube.java

示例14: getSoapHandlers

import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
public List<SOAPHandler> getSoapHandlers() {
    return soapHandlers;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:HandlerConfiguration.java

示例15: SOAPConfigDelegateHandler

import javax.xml.ws.handler.soap.SOAPHandler; //导入依赖的package包/类
public SOAPConfigDelegateHandler(SOAPHandler<T> delegate, boolean isPre) {
   super(delegate, isPre);
}
 
开发者ID:jbossws,项目名称:jbossws-common,代码行数:4,代码来源:SOAPConfigDelegateHandler.java


注:本文中的javax.xml.ws.handler.soap.SOAPHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。