use of org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier in project cxf by apache.
the class TestUtils method createTeachersServers.
protected static void createTeachersServers(String port) {
ResourceManager teachersResourceManager = new MemoryResourceManager();
ResourceRemote resource = new ResourceRemote();
resource.setManager(teachersResourceManager);
resource.getResourceTypeIdentifiers().add(new XSDResourceTypeIdentifier(new StreamSource(TestUtils.class.getResourceAsStream("/schema/teacher.xsd")), new XSLTResourceTransformer(new StreamSource(TestUtils.class.getResourceAsStream("/xslt/teacherDefaultValues.xsl")), new TeacherResourceValidator())));
teachersResourceFactoryServer = createTeachersResourceFactoryEndpoint(resource, port);
teachersResourceServer = createTeacherResourceEndpoint(resource, port);
}
use of org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier 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();
}
use of org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier in project cxf by apache.
the class TestUtils method createResourceFactory.
private static Server createResourceFactory(ResourceManager resourceManager, String port, String port2) {
ResourceFactoryImpl resourceFactory = new ResourceFactoryImpl();
resourceFactory.setResourceResolver(new MyResourceResolver("http://localhost:" + port + "/ResourceStudents", resourceManager, "http://localhost:" + port2 + "/ResourceTeachers"));
resourceFactory.getResourceTypeIdentifiers().add(new XSDResourceTypeIdentifier(new StreamSource(TestUtils.class.getResourceAsStream("/schema/studentCreate.xsd")), new XSLTResourceTransformer(new StreamSource(TestUtils.class.getResourceAsStream("/xslt/studentCreate.xsl")))));
resourceFactory.getResourceTypeIdentifiers().add(new XSDResourceTypeIdentifier(new StreamSource(TestUtils.class.getResourceAsStream("/schema/teacherCreateBasic.xsd")), new XSLTResourceTransformer(new StreamSource(TestUtils.class.getResourceAsStream("/xslt/teacherCreateBasic.xsl")))));
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory.class);
factory.setServiceBean(resourceFactory);
factory.setAddress("http://localhost:" + port + "/ResourceFactory");
return factory.create();
}
Aggregations