Examples of TypeNameStrategy


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

        return new RouteBuilder() {
            String jaxbPackage = GetCustomersByName.class.getPackage().getName();

            @Override
            public void configure() throws Exception {
                ElementNameStrategy elNameStrat = new TypeNameStrategy();
                SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
                CustomerServiceImpl serverBean = new CustomerServiceImpl();
                from("direct:start").onException(Exception.class) //
                        .handled(true) //
                        .marshal(soapDataFormat) //
View Full Code Here

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

    /**
     * Create data format by using the constructor
     */
    protected SoapJaxbDataFormat createDataFormat() {
        String jaxbPackage = GetCustomersByName.class.getPackage().getName();
        ElementNameStrategy elStrat = new TypeNameStrategy();
        SoapJaxbDataFormat answer = new SoapJaxbDataFormat(jaxbPackage, elStrat);
        answer.setVersion("1.2");
        return answer;
    }
View Full Code Here

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

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

            @Override
            public void configure() throws Exception {
                ElementNameStrategy elNameStrat = new TypeNameStrategy();
                from("direct:start")
                    .marshal().soapjaxb(jaxbPackage, elNameStrat)
                    .unmarshal().soapjaxb(jaxbPackage, elNameStrat)
                    .to("mock:result");
            }
View Full Code Here

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

                } else {
                    if (elementNameStrategyRef != null) {
                        elementNameStrategy = exchange.getContext().getRegistry().lookup(elementNameStrategyRef,
                                ElementNameStrategy.class);
                    } else {
                        elementNameStrategy = new TypeNameStrategy();
                    }
                }
            }
        }
    }
View Full Code Here

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

                } else {
                    if (elementNameStrategyRef != null) {
                        elementNameStrategy = exchange.getContext().getRegistry().lookup(elementNameStrategyRef,
                                ElementNameStrategy.class);
                    } else {
                        elementNameStrategy = new TypeNameStrategy();
                    }
                }
            }
        }
    }
View Full Code Here

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

        return new RouteBuilder() {
            String jaxbPackage = GetCustomersByName.class.getPackage().getName();

            @Override
            public void configure() throws Exception {
                ElementNameStrategy elNameStrat = new TypeNameStrategy();
                SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
                CustomerServiceImpl serverBean = new CustomerServiceImpl();
                from("direct:start").onException(Exception.class) //
                        .handled(true) //
                        .marshal(soapDataFormat) //
View Full Code Here

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

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

            @Override
            public void configure() throws Exception {
                ElementNameStrategy elNameStrat = new TypeNameStrategy();
                from("direct:start")
                    .marshal().soapjaxb(jaxbPackage, elNameStrat)
                    .unmarshal().soapjaxb(jaxbPackage, elNameStrat)
                    .to("mock:result");
            }
View Full Code Here

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

public class TypeNameStrategyTest {

    @Test
    public void testTypeNameStrategy() {
        TypeNameStrategy strategy = new TypeNameStrategy();
        QName name = strategy.findQNameForSoapActionOrType("", GetCustomersByName.class);
        Assert.assertEquals("http://customerservice.example.com/", name.getNamespaceURI());
        Assert.assertEquals("getCustomersByName", name.getLocalPart());
    }
View Full Code Here

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

        Assert.assertEquals("getCustomersByName", name.getLocalPart());
    }

    @Test
    public void testNoAnnotation() {
        TypeNameStrategy strategy = new TypeNameStrategy();
        try {
            strategy.findQNameForSoapActionOrType("", String.class);
            Assert.fail();
        } catch (RuntimeException e) {
            // Expected here
        }
    }
View Full Code Here

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

        }
    }

    @Test
    public void testNoPackageInfo() {
        TypeNameStrategy strategy = new TypeNameStrategy();
        QName name = strategy.findQNameForSoapActionOrType("", AnnotatedClassWithoutNamespace.class);
        Assert.assertEquals("test", name.getLocalPart());
        Assert.assertEquals("##default", name.getNamespaceURI());

        QName name2 = strategy.findQNameForSoapActionOrType("", AnnotatedClassWithNamespace.class);
        Assert.assertEquals("test", name2.getLocalPart());
        Assert.assertEquals("http://mynamespace", name2.getNamespaceURI());
    }
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.