Package org.apache.cxf.binding.soap.interceptor

Examples of org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor


        message = sb.createMessage(message);
        assertNotNull(message);
        assertTrue(message instanceof SoapMessage);
        SoapMessage soapMessage = (SoapMessage) message;
        assertEquals(Soap11.getInstance(), soapMessage.getVersion());
        (new SoapActionInterceptor()).handleMessage(soapMessage);
        Map<String, List<String>> reqHeaders = CastUtils.cast((Map)soapMessage.get(Message.PROTOCOL_HEADERS));
        assertNotNull(reqHeaders);
        assertEquals("\"\"", reqHeaders.get("SOAPAction").get(0));

        sb.setSoapVersion(Soap12.getInstance());
        soapMessage = (SoapMessage) sb.createMessage(soapMessage);
        (new SoapActionInterceptor()).handleMessage(soapMessage);
        reqHeaders = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
        assertNotNull(reqHeaders);
        assertEquals("\"\"", reqHeaders.get("action").get(0));
    }
View Full Code Here


        }

        sb.getInInterceptors().add(new AttachmentInInterceptor());
        sb.getInInterceptors().add(new StaxInInterceptor());
       
        sb.getOutInterceptors().add(new SoapActionInterceptor());
        sb.getOutInterceptors().add(new AttachmentOutInterceptor());
        sb.getOutInterceptors().add(new StaxOutInterceptor());
       
        sb.getOutFaultInterceptors().add(new StaxOutInterceptor());
View Full Code Here

public class SoapActionInterceptorTest extends Assert {

   
    @Test
    public void testSoapAction() throws Exception {
        SoapActionInterceptor i = new SoapActionInterceptor();
       
        Message message = new MessageImpl();
        message.setExchange(new ExchangeImpl());
        message.getExchange().setOutMessage(message);
        SoapBinding sb = new SoapBinding(null);
        message = sb.createMessage(message);
        assertNotNull(message);
        assertTrue(message instanceof SoapMessage);
        SoapMessage soapMessage = (SoapMessage) message;
        assertEquals(Soap11.getInstance(), soapMessage.getVersion());
        (new SoapActionInterceptor()).handleMessage(soapMessage);
        Map<String, List<String>> reqHeaders = CastUtils.cast((Map)soapMessage.get(Message.PROTOCOL_HEADERS));
        assertNotNull(reqHeaders);
        assertEquals("\"\"", reqHeaders.get("SOAPAction").get(0));

        sb.setSoapVersion(Soap12.getInstance());
        soapMessage.clear();
        soapMessage = (SoapMessage) sb.createMessage(soapMessage);
        i.handleMessage(soapMessage);
        String ct = (String) message.get(Message.CONTENT_TYPE);
        assertEquals("application/soap+xml", ct);
       
        BindingOperationInfo bop = createBindingOperation();
        message.getExchange().put(BindingOperationInfo.class, bop);
        SoapOperationInfo soapInfo = new SoapOperationInfo();
        soapInfo.setAction("foo");
        bop.addExtensor(soapInfo);
       
        i.handleMessage(soapMessage);
        ct = (String) message.get(Message.CONTENT_TYPE);
        assertEquals("application/soap+xml; action=\"foo\"", ct);
    }
View Full Code Here

        }

        sb.getInInterceptors().add(new AttachmentInInterceptor());
        sb.getInInterceptors().add(new StaxInInterceptor());
       
        sb.getOutInterceptors().add(new SoapActionInterceptor());
        sb.getOutInterceptors().add(new AttachmentOutInterceptor());
        sb.getOutInterceptors().add(new StaxOutInterceptor());
       
        sb.getOutFaultInterceptors().add(new StaxOutInterceptor());
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor

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.