Search in sources :

Example 1 with ResourceLocal

use of org.apache.cxf.ws.transfer.resource.ResourceLocal in project cxf by apache.

the class TestUtils method createStudentsResource.

private static Server createStudentsResource(ResourceManager resourceManager, String port) {
    ResourceLocal resourceLocal = new ResourceLocal();
    resourceLocal.setManager(resourceManager);
    resourceLocal.getResourceTypeIdentifiers().add(new XSDResourceTypeIdentifier(new StreamSource(TestUtils.class.getResourceAsStream("/schema/studentPut.xsd")), new XSLTResourceTransformer(new StreamSource(TestUtils.class.getResourceAsStream("/xslt/studentPut.xsl")), new StudentPutResourceValidator())));
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    factory.setServiceClass(Resource.class);
    factory.setServiceBean(resourceLocal);
    factory.setAddress("http://localhost:" + port + "/ResourceStudents");
    return factory.create();
}
Also used : StreamSource(javax.xml.transform.stream.StreamSource) ResourceLocal(org.apache.cxf.ws.transfer.resource.ResourceLocal) StudentPutResourceValidator(org.apache.cxf.systest.ws.transfer.validator.StudentPutResourceValidator) XSLTResourceTransformer(org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransformer) XSDResourceTypeIdentifier(org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean)

Example 2 with ResourceLocal

use of org.apache.cxf.ws.transfer.resource.ResourceLocal in project cxf by apache.

the class IntegrationBaseTest method createLocalResource.

protected Server createLocalResource(ResourceManager manager) {
    ResourceLocal implementor = new ResourceLocal();
    implementor.setManager(manager);
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    Map<String, Object> props = factory.getProperties(true);
    props.put("jaxb.additionalContextClasses", org.apache.cxf.ws.transfer.dialect.fragment.ExpressionType.class);
    factory.setProperties(props);
    factory.setBus(bus);
    factory.setServiceClass(Resource.class);
    factory.setAddress(RESOURCE_LOCAL_ADDRESS);
    factory.setServiceBean(implementor);
    return factory.create();
}
Also used : ResourceLocal(org.apache.cxf.ws.transfer.resource.ResourceLocal) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean)

Aggregations

JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 ResourceLocal (org.apache.cxf.ws.transfer.resource.ResourceLocal)2 StreamSource (javax.xml.transform.stream.StreamSource)1 StudentPutResourceValidator (org.apache.cxf.systest.ws.transfer.validator.StudentPutResourceValidator)1 XSDResourceTypeIdentifier (org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier)1 XSLTResourceTransformer (org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransformer)1