Search in sources :

Example 11 with ResourceFactory

use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.

the class DeleteTest method createStudent.

private CreateResponse createStudent() throws XMLStreamException {
    Document createStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createStudent.xml"));
    Create request = new Create();
    request.setRepresentation(new Representation());
    request.getRepresentation().setAny(createStudentXML.getDocumentElement());
    ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
    return rf.create(request);
}
Also used : Create(org.apache.cxf.ws.transfer.Create) Representation(org.apache.cxf.ws.transfer.Representation) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory) Document(org.w3c.dom.Document)

Example 12 with ResourceFactory

use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.

the class PutTest method createTeacher.

private CreateResponse createTeacher() throws XMLStreamException {
    Document createTeacherXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createTeacher.xml"));
    Create request = new Create();
    request.setRepresentation(new Representation());
    request.getRepresentation().setAny(createTeacherXML.getDocumentElement());
    ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
    return rf.create(request);
}
Also used : Create(org.apache.cxf.ws.transfer.Create) Representation(org.apache.cxf.ws.transfer.Representation) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory) Document(org.w3c.dom.Document)

Example 13 with ResourceFactory

use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.

the class PutTest method createStudent.

private CreateResponse createStudent() throws XMLStreamException {
    Document createStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createStudent.xml"));
    Create request = new Create();
    request.setRepresentation(new Representation());
    request.getRepresentation().setAny(createStudentXML.getDocumentElement());
    ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
    return rf.create(request);
}
Also used : Create(org.apache.cxf.ws.transfer.Create) Representation(org.apache.cxf.ws.transfer.Representation) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory) Document(org.w3c.dom.Document)

Example 14 with ResourceFactory

use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.

the class TestUtils method createResourceFactoryClient.

protected static ResourceFactory createResourceFactoryClient(String port) {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setServiceClass(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory.class);
    factory.setAddress("http://localhost:" + port + "/ResourceFactory");
    return (ResourceFactory) factory.create();
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory)

Example 15 with ResourceFactory

use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.

the class ResourceFactoryTest method createClient.

private ResourceFactory createClient() {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setBus(bus);
    factory.setServiceClass(ResourceFactory.class);
    factory.setAddress(RESOURCE_FACTORY_ADDRESS);
    return (ResourceFactory) factory.create();
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory)

Aggregations

ResourceFactory (org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory)16 Create (org.apache.cxf.ws.transfer.Create)14 Representation (org.apache.cxf.ws.transfer.Representation)14 Document (org.w3c.dom.Document)12 Test (org.junit.Test)9 CreateResponse (org.apache.cxf.ws.transfer.CreateResponse)6 Server (org.apache.cxf.endpoint.Server)2 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)2 ReferenceParametersType (org.apache.cxf.ws.addressing.ReferenceParametersType)2 ResourceManager (org.apache.cxf.ws.transfer.manager.ResourceManager)2 Element (org.w3c.dom.Element)2 BeforeClass (org.junit.BeforeClass)1