Search in sources :

Example 1 with XSDResourceTypeIdentifier

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);
}
Also used : ResourceRemote(org.apache.cxf.ws.transfer.resource.ResourceRemote) StreamSource(javax.xml.transform.stream.StreamSource) TeacherResourceValidator(org.apache.cxf.systest.ws.transfer.validator.TeacherResourceValidator) XSLTResourceTransformer(org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransformer) MemoryResourceManager(org.apache.cxf.ws.transfer.manager.MemoryResourceManager) ResourceManager(org.apache.cxf.ws.transfer.manager.ResourceManager) MemoryResourceManager(org.apache.cxf.ws.transfer.manager.MemoryResourceManager) XSDResourceTypeIdentifier(org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier)

Example 2 with XSDResourceTypeIdentifier

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();
}
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 3 with XSDResourceTypeIdentifier

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();
}
Also used : MyResourceResolver(org.apache.cxf.systest.ws.transfer.resolver.MyResourceResolver) StreamSource(javax.xml.transform.stream.StreamSource) XSLTResourceTransformer(org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransformer) ResourceFactoryImpl(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactoryImpl) XSDResourceTypeIdentifier(org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean)

Aggregations

StreamSource (javax.xml.transform.stream.StreamSource)3 XSDResourceTypeIdentifier (org.apache.cxf.ws.transfer.validationtransformation.XSDResourceTypeIdentifier)3 XSLTResourceTransformer (org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransformer)3 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 MyResourceResolver (org.apache.cxf.systest.ws.transfer.resolver.MyResourceResolver)1 StudentPutResourceValidator (org.apache.cxf.systest.ws.transfer.validator.StudentPutResourceValidator)1 TeacherResourceValidator (org.apache.cxf.systest.ws.transfer.validator.TeacherResourceValidator)1 MemoryResourceManager (org.apache.cxf.ws.transfer.manager.MemoryResourceManager)1 ResourceManager (org.apache.cxf.ws.transfer.manager.ResourceManager)1 ResourceLocal (org.apache.cxf.ws.transfer.resource.ResourceLocal)1 ResourceRemote (org.apache.cxf.ws.transfer.resource.ResourceRemote)1 ResourceFactoryImpl (org.apache.cxf.ws.transfer.resourcefactory.ResourceFactoryImpl)1