Search in sources :

Example 6 with TypeNameStrategy

use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.

the class TypeNameStrategyTest method testNoAnnotation.

@Test
public void testNoAnnotation() {
    TypeNameStrategy strategy = new TypeNameStrategy();
    try {
        strategy.findQNameForSoapActionOrType("", String.class);
        Assert.fail();
    } catch (RuntimeException e) {
    // Expected here
    }
}
Also used : TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy) Test(org.junit.Test)

Example 7 with TypeNameStrategy

use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.

the class Soap12MarshalTest method createDataFormat.

/**
     * 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;
}
Also used : ElementNameStrategy(org.apache.camel.dataformat.soap.name.ElementNameStrategy) GetCustomersByName(com.example.customerservice.GetCustomersByName) SoapJaxbDataFormat(org.apache.camel.dataformat.soap.SoapJaxbDataFormat) TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy)

Example 8 with TypeNameStrategy

use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.

the class SoapMarshalTest method createDataFormat.

/**
     * 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);
}
Also used : ElementNameStrategy(org.apache.camel.dataformat.soap.name.ElementNameStrategy) GetCustomersByName(com.example.customerservice.GetCustomersByName) TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy)

Example 9 with TypeNameStrategy

use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.

the class SoapRoundtripTest method createRouteBuilder.

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {

        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");
        }
    };
}
Also used : ElementNameStrategy(org.apache.camel.dataformat.soap.name.ElementNameStrategy) RouteBuilder(org.apache.camel.builder.RouteBuilder) TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy)

Example 10 with TypeNameStrategy

use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.

the class TypeNameStrategyTest method testTypeNameStrategy.

@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());
}
Also used : QName(javax.xml.namespace.QName) TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy) Test(org.junit.Test)

Aggregations

TypeNameStrategy (org.apache.camel.dataformat.soap.name.TypeNameStrategy)10 ElementNameStrategy (org.apache.camel.dataformat.soap.name.ElementNameStrategy)4 BeforeClass (org.junit.BeforeClass)3 Test (org.junit.Test)3 GetCustomersByName (com.example.customerservice.GetCustomersByName)2 QName (javax.xml.namespace.QName)2 RouteBuilder (org.apache.camel.builder.RouteBuilder)2 SoapJaxbDataFormat (org.apache.camel.dataformat.soap.SoapJaxbDataFormat)1