Java 类org.apache.camel.component.cxf.DataFormat 实例源码

项目:cxf_over_jms_kata    文件:CamelConfig.java   
@Bean(name = "helloEndpoint")
public CxfEndpoint userServiceEndpoint() {
    CxfEndpoint cxfEndpoint = new CxfEndpoint();
    cxfEndpoint.setAddress("http://localhost:8888/services/hello");
    cxfEndpoint.setServiceClass(HelloWorld.class);
    LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
    loggingInInterceptor.setPrettyLogging(true);
    LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
    loggingOutInterceptor.setPrettyLogging(true);
    cxfEndpoint.getOutInterceptors().add(loggingOutInterceptor);
    cxfEndpoint.getInInterceptors().add(loggingInInterceptor);
    cxfEndpoint.setDataFormat(DataFormat.POJO);
    final Map<String, Object> properties = new HashMap<>();
    properties.put("schema-validation-enabled", "true");
    properties.put("bus.jmx.enabled", "true");

    //properties.setProperty("faultStackTraceEnabled", "true");
    //properties.setProperty("exceptionMessageCauseEnabled", "true");
    //properties.setProperty("schema-validation-enabled", "false");

    //properties.put("allowStreaming", true);
    cxfEndpoint.configureProperties(properties);
    return cxfEndpoint;
}
项目:morc    文件:CxfEndpointOverride.java   
@Override
public void overrideEndpoint(Endpoint endpoint) {
    if (endpoint instanceof CxfEndpoint) {
        ((CxfEndpoint) endpoint).setDataFormat(DataFormat.PAYLOAD);
        //Works around issue: https://issues.apache.org/jira/browse/CXF-2775
        System.setProperty("org.apache.cxf.transports.http_jetty.DontClosePort", "true");
    }
}
项目:Camel    文件:CxfConverter.java   
@Converter
public static DataFormat toDataFormat(final String name) {
    return DataFormat.valueOf(name.toUpperCase());
}
项目:Camel    文件:CxfEndpointUtilsTest.java   
@SuppressWarnings("deprecation")
@Test
public void testGetDataFormatMessage() throws Exception {
    CxfEndpoint endpoint = createEndpoint(getEndpointURI() + sepChar() + "dataFormat=MESSAGE");
    assertEquals("We should get the Message DataFormat", DataFormat.MESSAGE, endpoint.getDataFormat());
}
项目:Camel    文件:CxfEndpointUtilsTest.java   
@Test
public void testGetDataFormatCXF() throws Exception {
    CxfEndpoint endpoint = createEndpoint(getEndpointURI() + sepChar() + "dataFormat=CXF_MESSAGE");
    assertEquals("We should get the Message DataFormat", DataFormat.CXF_MESSAGE, endpoint.getDataFormat());
}
项目:Camel    文件:CxfEndpointUtilsTest.java   
@Test
public void testGetDataFormatRAW() throws Exception {
    CxfEndpoint endpoint = createEndpoint(getEndpointURI() + sepChar() + "dataFormat=RAW");
    assertEquals("We should get the Message DataFormat", DataFormat.RAW, endpoint.getDataFormat());
}
项目:Camel    文件:CxfEndpointUtilsWithSpringTest.java   
@Test
public void testGetDataFormatFromCxfEndpontProperties() throws Exception {
    CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?dataFormat=PAYLOAD");
    assertEquals("We should get the PAYLOAD DataFormat", DataFormat.PAYLOAD, endpoint.getDataFormat());
}