Search in sources :

Example 1 with StaxDataBindingFeature

use of org.apache.cxf.databinding.stax.StaxDataBindingFeature in project cxf by apache.

the class StaxDatabindingTest method testCallback.

@Test
public void testCallback() throws Exception {
    String address = "local://foo";
    ServerFactoryBean sf = new ServerFactoryBean();
    sf.setServiceBean(new CallbackService());
    sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
    sf.setAddress(address);
    sf.setDataBinding(new StaxDataBinding());
    sf.getFeatures().add(new StaxDataBindingFeature());
    sf.setBus(getBus());
    sf.create();
    Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID, "req.xml");
    assertValid("//bleh", res);
}
Also used : StaxDataBindingFeature(org.apache.cxf.databinding.stax.StaxDataBindingFeature) Node(org.w3c.dom.Node) StaxDataBinding(org.apache.cxf.databinding.stax.StaxDataBinding) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) Test(org.junit.Test) AbstractCXFTest(org.apache.cxf.test.AbstractCXFTest)

Example 2 with StaxDataBindingFeature

use of org.apache.cxf.databinding.stax.StaxDataBindingFeature in project cxf by apache.

the class StaxDatabindingTest method testCopy.

@Test
public void testCopy() throws Exception {
    String address = "local://foo";
    ServerFactoryBean sf = new ServerFactoryBean();
    sf.setServiceBean(new CopyService());
    sf.setBus(getBus());
    sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
    sf.setAddress(address);
    sf.setDataBinding(new StaxDataBinding());
    sf.getFeatures().add(new StaxDataBindingFeature());
    sf.create().start();
    Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID, "req.xml");
    // DOMUtils.writeXml(res, System.out);
    addNamespace("a", "http://stax.service.cxf.apache.org/");
    assertValid("//a:bleh", res);
}
Also used : StaxDataBindingFeature(org.apache.cxf.databinding.stax.StaxDataBindingFeature) Node(org.w3c.dom.Node) StaxDataBinding(org.apache.cxf.databinding.stax.StaxDataBinding) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) Test(org.junit.Test) AbstractCXFTest(org.apache.cxf.test.AbstractCXFTest)

Aggregations

StaxDataBinding (org.apache.cxf.databinding.stax.StaxDataBinding)2 StaxDataBindingFeature (org.apache.cxf.databinding.stax.StaxDataBindingFeature)2 ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)2 AbstractCXFTest (org.apache.cxf.test.AbstractCXFTest)2 Test (org.junit.Test)2 Node (org.w3c.dom.Node)2