Package javax.xml.ws.handler

Examples of javax.xml.ws.handler.MessageContext


        // TODO: if null consider throwing IllegalStateException?
        return ctx.getMessageContext();
    }
   
    private HttpServletRequest getHttpServletRequest() {
        MessageContext ctx = getMessageContext();
        return (ctx != null) ? (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST) : null;
    }
View Full Code Here


  
        // Find processed token corresponding to the URI
        if (referenceURI.charAt(0) == '#') {
            referenceURI = referenceURI.substring(1);
        }
        MessageContext messageContext = wsContext.getMessageContext();
        final List<WSHandlerResult> handlerResults =
            CastUtils.cast((List<?>) messageContext.get(WSHandlerConstants.RECV_RESULTS));
       
        if (handlerResults != null && handlerResults.size() > 0) {
            WSHandlerResult handlerResult = handlerResults.get(0);
            List<WSSecurityEngineResult> engineResults = handlerResult.getResults();
           
View Full Code Here

        }
    }

    public static void storeCXfResponseContext(Message response, Map<String, Object> context) {
        if (context != null) {
            MessageContext messageContext = new WrappedMessageContext(context, null, Scope.HANDLER);
            response.put(Client.RESPONSE_CONTEXT, messageContext);
            //put the ResponseCode in the response context
            Object value = context.get(Message.RESPONSE_CODE);
            if (value != null) {
                response.put(Message.RESPONSE_CODE, value);
View Full Code Here

     *
     * @param ctx       The MessageContext to set
     * @return          The former MessageContext reference, if any.
     */
    public static MessageContext setMessageContext(MessageContext ctx) {
        MessageContext oldCtx = context.get();
        context.set(ctx);
        return oldCtx;
    }
View Full Code Here

        // set up the webservice request context
        WrappedMessageContext ctx = new WrappedMessageContext(exchange.getInMessage(), Scope.APPLICATION);
       
        Map<String, Object> handlerScopedStuff = removeHandlerProperties(ctx);
       
        final MessageContext oldCtx = WebServiceContextImpl.setMessageContext(ctx);
        List<Object> res = null;
        try {
            if ((params == null || params.isEmpty()) && m.getDeclaringClass().equals(Provider.class)) {
                params = Collections.singletonList(null);
            }
View Full Code Here

        }
    }

    private boolean handleMessageInternal(SoapMessage message) {
       
        MessageContext context = createProtocolMessageContext(message);
        if (context == null) {
            return true;
        }
               
        HandlerChainInvoker invoker = getInvoker(message);
View Full Code Here

    public int add(int n1, int n2) {
        return n1 + n2;
    }
   
    public int multiply(int n1, int n2) {
        MessageContext ctx = context.getMessageContext();
        CalculatorHandler.verifyReferenceParameter(ctx);
        return n1 * n2;
    }
View Full Code Here

    public int add(int n1, int n2) {
        return n1 + n2;
    }
   
    public int multiply(int n1, int n2) {
        MessageContext ctx = context.getMessageContext();
        CalculatorHandler.verifyReferenceParameter(ctx);
        return n1 * n2;
    }
View Full Code Here

    public String greetMe(String me) {
        LOG.info("WebServiceContext: " + context);
        LOG.info("Principal: " + context.getUserPrincipal());
        LOG.info("Context: " + context.getMessageContext());

        MessageContext ctx = context.getMessageContext();
        Iterator iter = ctx.entrySet().iterator();
        while(iter.hasNext()) {
            Map.Entry entry = (Map.Entry)iter.next();
            System.out.println("Key: "+entry.getKey());
            System.out.println("Value: " +entry.getValue());
        }
View Full Code Here

   WebServiceContext wsCtx;

   @WebMethod
   public String testGetMessageContext()
   {
      MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
      return msgContext == null ? "fail" : "pass";
   }
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.MessageContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.