Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.DocLiteralInInterceptor


    @Test
    public void testInterceptorInboundWrapped() throws Exception {
        setUpUsingHelloWorld();

        //WrappedInInterceptor interceptor = new WrappedInInterceptor();
        DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();

        message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
            .createXMLStreamReader(getTestStream(getClass(), "resources/GreetMeDocLiteralReq.xml")));
        XMLStreamReader reader = message.getContent(XMLStreamReader.class);
        // skip the start element of soap body
        StaxUtils.skipToStartOfElement(reader);

        message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);

        interceptor.handleMessage(message);

        assertNull(message.getContent(Exception.class));

        List<?> parameters = message.getContent(List.class);
        assertEquals(1, parameters.size());
View Full Code Here


    @Test
    public void testInterceptorInboundBare() throws Exception {
        setUpUsingDocLit();

        DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();
        message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
            .createXMLStreamReader(getTestStream(getClass(), "resources/sayHiDocLitBareReq.xml")));
        XMLStreamReader reader = message.getContent(XMLStreamReader.class);
        // skip the start element of soap body
        StaxUtils.skipToStartOfElement(reader);

        message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);

        interceptor.handleMessage(message);

        assertNull(message.getContent(Exception.class));

        List<?> parameters = message.getContent(List.class);
        assertEquals(1, parameters.size());
View Full Code Here

    @Test
    public void testInterceptorInboundBareNoParameter() throws Exception {
        setUpUsingDocLit();

        DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();
        message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
            .createXMLStreamReader(getTestStream(getClass(), "resources/bareNoParamDocLitBareReq.xml")));

        XMLStreamReader reader = message.getContent(XMLStreamReader.class);
        // skip the start element of soap body, so that we can serve an empty request to
        // interceptor
        StaxUtils.skipToStartOfElement(reader);
        StaxUtils.nextEvent(reader);

        message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);

        interceptor.handleMessage(message);

        assertNull(message.getContent(Exception.class));

        List<?> parameters = message.getContent(List.class);
        assertNull(parameters);
View Full Code Here

                sb.getInInterceptors().add(new RPCInInterceptor());
                sb.getOutInterceptors().add(new RPCOutInterceptor());
            } else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                            && SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle)) {
                //sb.getInInterceptors().add(new BareInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                if (hasWrapped) {
                    sb.getOutInterceptors().add(new WrappedOutInterceptor());                   
                }
                sb.getOutInterceptors().add(new BareOutInterceptor());
            } else {
                //sb.getInInterceptors().add(new WrappedInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                sb.getOutInterceptors().add(new WrappedOutInterceptor());
                sb.getOutInterceptors().add(new BareOutInterceptor());
            }
            sb.getInInterceptors().add(new SoapHeaderInterceptor());
View Full Code Here

            xb.getInInterceptors().add(new StaxInInterceptor());
            xb.getOutInterceptors().add(new StaxOutInterceptor());
           
            xb.getInInterceptors().add(new URIMappingInterceptor());
            xb.getOutInterceptors().add(new XMLMessageOutInterceptor());
            xb.getInInterceptors().add(new DocLiteralInInterceptor());
            xb.getInInterceptors().add(new XMLMessageInInterceptor());
        }       

        xb.getInFaultInterceptors().add(new XMLFaultInInterceptor());
        xb.getOutFaultInterceptors().add(new StaxOutInterceptor());
View Full Code Here

        if (parts.size() > 1) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("SINGLE_PART_REQUIRED", LOG));
        }

        message.getInterceptorChain().add(new XMLMessageInInterceptor());
        message.getInterceptorChain().add(new DocLiteralInInterceptor());

        MessagePartInfo part = parts.get(0);

        List<Param> params = null;
        if ("application/x-www-form-urlencoded.".equals(contentType)) {
View Full Code Here

                sb.getInInterceptors().add(new RPCInInterceptor());
                sb.getOutInterceptors().add(new RPCOutInterceptor());
            } else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                            && SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle)) {
                //sb.getInInterceptors().add(new BareInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                sb.getOutInterceptors().add(new BareOutInterceptor());
            } else {
                //sb.getInInterceptors().add(new WrappedInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                sb.getOutInterceptors().add(new WrappedOutInterceptor());
                sb.getOutInterceptors().add(new BareOutInterceptor());
            }
            sb.getInInterceptors().add(new SoapHeaderInterceptor());
View Full Code Here

        XMLBinding xb = new XMLBinding(binding);
       
        xb.getInInterceptors().add(new AttachmentInInterceptor());   
        xb.getInInterceptors().add(new StaxInInterceptor());
        xb.getInInterceptors().add(new URIMappingInterceptor());
        xb.getInInterceptors().add(new DocLiteralInInterceptor());
        xb.getInInterceptors().add(new XMLMessageInInterceptor());
       
        xb.getOutInterceptors().add(new AttachmentOutInterceptor());
        xb.getOutInterceptors().add(new StaxOutInterceptor());
        xb.getOutInterceptors().add(new WrappedOutInterceptor());
View Full Code Here

                sb.getInInterceptors().add(new RPCInInterceptor());
                sb.getOutInterceptors().add(new RPCOutInterceptor());
            } else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                            && SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle)) {
                //sb.getInInterceptors().add(new BareInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                sb.getOutInterceptors().add(new BareOutInterceptor());
            } else {
                //sb.getInInterceptors().add(new WrappedInInterceptor());
                sb.getInInterceptors().add(new DocLiteralInInterceptor());
                sb.getOutInterceptors().add(new WrappedOutInterceptor());
                sb.getOutInterceptors().add(new BareOutInterceptor());
            }
            sb.getInInterceptors().add(new SoapHeaderInterceptor());
        }
View Full Code Here

        if (parts.size() > 1) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("SINGLE_PART_REQUIRED", BUNDLE));
        }

        message.getInterceptorChain().add(new XMLMessageInInterceptor());
        message.getInterceptorChain().add(new DocLiteralInInterceptor());

        MessagePartInfo part = parts.get(0);

        List<Param> params = null;
        if ("application/x-www-form-urlencoded.".equals(contentType)) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.interceptor.DocLiteralInInterceptor

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.