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

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


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

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

            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

    }

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

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

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

        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

        }
    }

    @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

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

TOP

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

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.