Examples of DocLiteralInInterceptor


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 = (XMLStreamReader)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

Examples of org.apache.cxf.interceptor.DocLiteralInInterceptor

    @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 = (XMLStreamReader)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

Examples of org.apache.cxf.interceptor.DocLiteralInInterceptor

                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

Examples of org.apache.cxf.interceptor.DocLiteralInInterceptor

    @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 = (XMLStreamReader)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

Examples of org.apache.cxf.interceptor.DocLiteralInInterceptor

        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

Examples of org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor

            sb.getInInterceptors().add(new RPCInInterceptor());
            sb.getOutInterceptors().add(new RPCOutInterceptor());
        } else if (SoapBindingConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                        && SoapBindingConstants.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

Examples of org.apache.cxf.wsdl.interceptors.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

Examples of org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor

    @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

Examples of org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor

    @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

Examples of org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor

    public Binding createBinding(BindingInfo binding) {
        XMLBinding xb = new XMLBinding(binding);
       
        xb.getInInterceptors().add(new AttachmentInInterceptor());   
        xb.getInInterceptors().add(new StaxInInterceptor());
        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
TOP
Copyright © 2018 www.massapi.com. 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.