Package org.apache.cxf.jaxws.context

Examples of org.apache.cxf.jaxws.context.WrappedMessageContext


        parameters.setKeyRequirements(keyRequirements);

        parameters.setPrincipal(new CustomTokenPrincipal("alice"));
        // Mock up message context
        MessageImpl msg = new MessageImpl();
        WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
        WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
        parameters.setWebServiceContext(webServiceContext);

        parameters.setAppliesToAddress("http://dummy-service.com/dummy");
View Full Code Here


        parameters.setKeyRequirements(keyRequirements);
       
        parameters.setPrincipal(new CustomTokenPrincipal("alice"));
        // Mock up message context
        MessageImpl msg = new MessageImpl();
        WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
        WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
        parameters.setWebServiceContext(webServiceContext);
       
        // Add STSProperties object
        StaticSTSProperties stsProperties = new StaticSTSProperties();
View Full Code Here

        parameters.setKeyRequirements(keyRequirements);

        parameters.setPrincipal(new CustomTokenPrincipal("alice"));
        // Mock up message context
        MessageImpl msg = new MessageImpl();
        WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
        WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
        parameters.setWebServiceContext(webServiceContext);

        parameters.setAppliesToAddress("http://dummy-service.com/dummy");
View Full Code Here

    }
   
    protected Map<String, Object> prepareRequest(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) throws Exception {
       
        // create invocation context
        WrappedMessageContext requestContext = new WrappedMessageContext(
                new HashMap<String, Object>(), null, Scope.APPLICATION);

        camelExchange.setProperty(Message.MTOM_ENABLED, String.valueOf(endpoint.isMtomEnabled()));
       
        // set data format mode in exchange
        DataFormat dataFormat = endpoint.getDataFormat();
        camelExchange.setProperty(CxfConstants.DATA_FORMAT_PROPERTY, dataFormat);  
        LOG.trace("Set Camel Exchange property: {}={}", DataFormat.class.getName(), dataFormat);
       
        if (endpoint.getMergeProtocolHeaders()) {
            camelExchange.setProperty(CxfConstants.CAMEL_CXF_PROTOCOL_HEADERS_MERGED, Boolean.TRUE);
        }
       
        // set data format mode in the request context
        requestContext.put(DataFormat.class.getName(), dataFormat);

        // don't let CXF ClientImpl close the input stream
        if (dataFormat.dealias() == DataFormat.RAW) {
            cxfExchange.put(Client.KEEP_CONDUIT_ALIVE, true);
            LOG.trace("Set CXF Exchange property: {}={}", Client.KEEP_CONDUIT_ALIVE, true);
        }
    
        // bind the request CXF exchange
        endpoint.getCxfBinding().populateCxfRequestFromExchange(cxfExchange, camelExchange,
                requestContext);
       
        // Remove protocol headers from scopes.  Otherwise, response headers can be
        // overwritten by request headers when SOAPHandlerInterceptor tries to create
        // a wrapped message context by the copyScoped() method.
        requestContext.getScopes().remove(Message.PROTOCOL_HEADERS);
       
        return requestContext.getWrappedMap();
    }
View Full Code Here

        client.invoke(callback, oi, params);
        return ret;
    }

    public Map<String, Object> getRequestContext() {
        return new WrappedMessageContext(this.getClient().getRequestContext(),
                                         null,
                                         Scope.APPLICATION);
    }
View Full Code Here

        return new WrappedMessageContext(this.getClient().getRequestContext(),
                                         null,
                                         Scope.APPLICATION);
    }
    public Map<String, Object> getResponseContext() {
        return new WrappedMessageContext(this.getClient().getResponseContext(),
                                                          null,
                                                          Scope.APPLICATION);
    }
View Full Code Here

    }

   
    private Map<String, Object> getRequestContextCopy() {
        Map<String, Object> realMap = new HashMap<String, Object>();
        WrappedMessageContext ctx = new WrappedMessageContext(realMap,
                                                              Scope.APPLICATION);
        // thread local contexts reflect currentRequestContext as of
        // last call to getRequestContext()
        if (isThreadLocalRequestContext()
            && null != requestContext.get()) {
            ctx.putAll(requestContext.get());
        } else {
            ctx.putAll(currentRequestContext);
        }
        return realMap;
    }
View Full Code Here

    }
   
    protected Map<String, Object> prepareRequest(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) throws Exception {
       
        // create invocation context
        WrappedMessageContext requestContext = new WrappedMessageContext(
                new HashMap<String, Object>(), null, Scope.APPLICATION);

        camelExchange.setProperty(Message.MTOM_ENABLED, String.valueOf(endpoint.isMtomEnabled()));
       
        // set data format mode in exchange
        DataFormat dataFormat = endpoint.getDataFormat();
        camelExchange.setProperty(CxfConstants.DATA_FORMAT_PROPERTY, dataFormat);  
        LOG.trace("Set Camel Exchange property: {}={}", DataFormat.class.getName(), dataFormat);
       
        if (endpoint.getMergeProtocolHeaders()) {
            camelExchange.setProperty(CxfConstants.CAMEL_CXF_PROTOCOL_HEADERS_MERGED, Boolean.TRUE);
        }
       
        // set data format mode in the request context
        requestContext.put(DataFormat.class.getName(), dataFormat);

        // don't let CXF ClientImpl close the input stream
        if (dataFormat.dealias() == DataFormat.RAW) {
            cxfExchange.put(Client.KEEP_CONDUIT_ALIVE, true);
            LOG.trace("Set CXF Exchange property: {}={}", Client.KEEP_CONDUIT_ALIVE, true);
        }
    
        // bind the request CXF exchange
        endpoint.getCxfBinding().populateCxfRequestFromExchange(cxfExchange, camelExchange,
                requestContext);
       
        // Remove protocol headers from scopes.  Otherwise, response headers can be
        // overwritten by request headers when SOAPHandlerInterceptor tries to create
        // a wrapped message context by the copyScoped() method.
        requestContext.getScopes().remove(Message.PROTOCOL_HEADERS);
       
        return requestContext.getWrappedMap();
    }
View Full Code Here

    }
   
    protected Map<String, Object> prepareRequest(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) throws Exception {
       
        // create invocation context
        WrappedMessageContext requestContext = new WrappedMessageContext(
                new HashMap<String, Object>(), null, Scope.APPLICATION);

        camelExchange.setProperty(Message.MTOM_ENABLED, String.valueOf(endpoint.isMtomEnabled()));
       
        // set data format mode in exchange
        DataFormat dataFormat = endpoint.getDataFormat();
        camelExchange.setProperty(CxfConstants.DATA_FORMAT_PROPERTY, dataFormat);  
        LOG.trace("Set Camel Exchange property: {}={}", DataFormat.class.getName(), dataFormat);
       
        if (endpoint.getMergeProtocolHeaders()) {
            camelExchange.setProperty(CxfConstants.CAMEL_CXF_PROTOCOL_HEADERS_MERGED, Boolean.TRUE);
        }
       
        // set data format mode in the request context
        requestContext.put(DataFormat.class.getName(), dataFormat);

        // don't let CXF ClientImpl close the input stream
        if (dataFormat.dealias() == DataFormat.RAW) {
            cxfExchange.put(Client.KEEP_CONDUIT_ALIVE, true);
            LOG.trace("Set CXF Exchange property: {}={}", Client.KEEP_CONDUIT_ALIVE, true);
        }
    
        // bind the request CXF exchange
        endpoint.getCxfBinding().populateCxfRequestFromExchange(cxfExchange, camelExchange,
                requestContext);
       
        // Remove protocol headers from scopes.  Otherwise, response headers can be
        // overwritten by request headers when SOAPHandlerInterceptor tries to create
        // a wrapped message context by the copyScoped() method.
        requestContext.getScopes().remove(Message.PROTOCOL_HEADERS);
       
        return requestContext.getWrappedMap();
    }
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);

        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.context.WrappedMessageContext

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.