Package org.apache.camel.dataformat.soap.name

Examples of org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy


       
        String soapAction = getSoapActionFromExchange(exchange);
       
        // Determine the method name for an eventual BeanProcessor in the route
        if (soapAction != null && elementNameStrategy instanceof ServiceInterfaceStrategy) {
            ServiceInterfaceStrategy strategy = (ServiceInterfaceStrategy) elementNameStrategy;
            String methodName = strategy.getMethodForSoapAction(soapAction);
            exchange.getOut().setHeader(Exchange.BEAN_METHOD_NAME, methodName);
        }
       
        // Store soap action for an eventual later marshal step.
        // This is necessary as the soap action in the message may get lost on the way
View Full Code Here


       
        String soapAction = getSoapActionFromExchange(exchange);
       
        // Determine the method name for an eventual BeanProcessor in the route
        if (soapAction != null && elementNameStrategy instanceof ServiceInterfaceStrategy) {
            ServiceInterfaceStrategy strategy = (ServiceInterfaceStrategy) elementNameStrategy;
            String methodName = strategy.getMethodForSoapAction(soapAction);
            exchange.getOut().setHeader(Exchange.BEAN_METHOD_NAME, methodName);
        }
       
        // Store soap action for an eventual later marshal step.
        // This is necessary as the soap action in the message may get lost on the way
View Full Code Here

            String jaxbPackage = GetCustomersByName.class.getPackage()
                    .getName();

            @Override
            public void configure() throws Exception {
                ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, true);
                SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(
                        jaxbPackage, elNameStrat);
                final InputStream in = this.getClass().getResourceAsStream(
                        "response.xml");
                from("direct:start").marshal(soapDataFormat)
View Full Code Here

        }
    }

    public void configure() throws Exception {
        String jaxbPackage = GetCustomersByName.class.getPackage().getName();
        ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, true);
        SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
        from("direct:camelClient") //
            .onException(NoSuchCustomerException.class) //
                .handled(true) //
                .unmarshal(soapDataFormat) //
View Full Code Here

public class ServiceInterfaceStrategyTest {
    private static final Log LOG = LogFactory.getLog(ServiceInterfaceStrategyTest.class);
   
    @Test
    public void testServiceInterfaceStrategyWithClient() {
        ServiceInterfaceStrategy strategy = new ServiceInterfaceStrategy(CustomerService.class, true);
        QName elName = strategy.findQNameForSoapActionOrType("", GetCustomersByName.class);
        Assert.assertEquals("http://customerservice.example.com/", elName.getNamespaceURI());
        Assert.assertEquals("getCustomersByName", elName.getLocalPart());
       
        QName elName2 = strategy.findQNameForSoapActionOrType("getCustomersByName", GetCustomersByName.class);
        Assert.assertEquals("http://customerservice.example.com/", elName2.getNamespaceURI());
        Assert.assertEquals("getCustomersByName", elName2.getLocalPart());
       
        try {
            elName = strategy.findQNameForSoapActionOrType("test", Class.class);
            Assert.fail();
        } catch (RuntimeCamelException e) {
            LOG.debug("Caught expected message: " + e.getMessage());
        }
    }
View Full Code Here

        }
    }
   
    @Test
    public void testServiceInterfaceStrategyWithServer() {
        ServiceInterfaceStrategy strategy = new ServiceInterfaceStrategy(CustomerService.class, false);
        QName elName = strategy.findQNameForSoapActionOrType("", GetCustomersByNameResponse.class);
        Assert.assertEquals("http://customerservice.example.com/", elName.getNamespaceURI());
        Assert.assertEquals("getCustomersByNameResponse", elName.getLocalPart());

        QName elName2 = strategy.findQNameForSoapActionOrType("getCustomersByName", GetCustomersByName.class);
        Assert.assertEquals("http://customerservice.example.com/", elName2.getNamespaceURI());
        Assert.assertEquals("getCustomersByNameResponse", elName2.getLocalPart());
       
        try {
            elName = strategy.findQNameForSoapActionOrType("test", Class.class);
            Assert.fail();
        } catch (RuntimeCamelException e) {
            LOG.debug("Caught expected message: " + e.getMessage());
        }
    }
View Full Code Here

        }
    }
   
    @Test
    public void testServiceInterfaceStrategyWithRequestWrapperAndClient() {
        ServiceInterfaceStrategy strategy = new ServiceInterfaceStrategy(com.example.customerservice2.CustomerService.class, true);
        QName elName = strategy.findQNameForSoapActionOrType("", com.example.customerservice2.GetCustomersByName.class);
        Assert.assertEquals("http://customerservice2.example.com/", elName.getNamespaceURI());
        Assert.assertEquals("getCustomersByName", elName.getLocalPart());
       
        try {
            elName = strategy.findQNameForSoapActionOrType("test", Class.class);
            Assert.fail();
        } catch (RuntimeCamelException e) {
            LOG.debug("Caught expected message: " + e.getMessage());
        }
    }
View Full Code Here

    }
   
    @Test
    public void testWithNonWebservice() {
        try {
            new ServiceInterfaceStrategy(ElementNameStrategy.class, true);
            Assert.fail();
        } catch (RuntimeCamelException e) {
            LOG.debug("Caught expected message: " + e.getMessage());
        }
    }
View Full Code Here

       
        String soapAction = getSoapActionFromExchange(exchange);
       
        // Determine the method name for an eventual BeanProcessor in the route
        if (soapAction != null && elementNameStrategy instanceof ServiceInterfaceStrategy) {
            ServiceInterfaceStrategy strategy = (ServiceInterfaceStrategy) elementNameStrategy;
            String methodName = strategy.getMethodForSoapAction(soapAction);
            exchange.getOut().setHeader(Exchange.BEAN_METHOD_NAME, methodName);
        }
       
        // Store soap action for an eventual later marshal step.
        // This is necessary as the soap action in the message may get lost on the way
View Full Code Here

    }

    public void configure() throws Exception {
        String jaxbPackage = GetCustomersByName.class.getPackage().getName();
        ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, false);
        SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
        getContext().setTracing(true);
        from("direct:cxfclient") //
                .onException(Exception.class).handled(true).marshal(soapDataFormat).end() //
                .unmarshal(soapDataFormat) //
View Full Code Here

TOP

Related Classes of org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy

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.