Search in sources :

Example 1 with ElementNameStrategy

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

the class SoapClientTest 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 ServiceInterfaceStrategy(CustomerService.class, true);
            SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
            final InputStream in = this.getClass().getResourceAsStream("response.xml");
            from("direct:start").marshal(soapDataFormat).process(new FileReplyProcessor(in)).unmarshal(soapDataFormat);
        }
    };
}
Also used : ServiceInterfaceStrategy(org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy) ElementNameStrategy(org.apache.camel.dataformat.soap.name.ElementNameStrategy) RouteBuilder(org.apache.camel.builder.RouteBuilder) InputStream(java.io.InputStream)

Example 2 with ElementNameStrategy

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

the class SoapCxfClientTest method configure.

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

Example 3 with ElementNameStrategy

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

the class SoapCxfServerTest method configure.

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").marshal(//
    soapDataFormat).to(//
    "direct:cxfEndpoint").unmarshal(soapDataFormat);
}
Also used : ServiceInterfaceStrategy(org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy) ElementNameStrategy(org.apache.camel.dataformat.soap.name.ElementNameStrategy) GetCustomersByName(com.example.customerservice.GetCustomersByName)

Example 4 with ElementNameStrategy

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

the class SoapServerTest 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();
            SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
            CustomerServiceImpl serverBean = new CustomerServiceImpl();
            // 
            from("direct:start").onException(Exception.class).handled(//
            true).marshal(//
            soapDataFormat).end().unmarshal(//
            soapDataFormat).bean(//
            serverBean).marshal(soapDataFormat);
        }
    };
}
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 5 with ElementNameStrategy

use of org.apache.camel.dataformat.soap.name.ElementNameStrategy 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)

Aggregations

ElementNameStrategy (org.apache.camel.dataformat.soap.name.ElementNameStrategy)7 GetCustomersByName (com.example.customerservice.GetCustomersByName)4 TypeNameStrategy (org.apache.camel.dataformat.soap.name.TypeNameStrategy)4 RouteBuilder (org.apache.camel.builder.RouteBuilder)3 ServiceInterfaceStrategy (org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy)3 InputStream (java.io.InputStream)1 SoapJaxbDataFormat (org.apache.camel.dataformat.soap.SoapJaxbDataFormat)1