diff options
Diffstat (limited to 'cxfImplementations/SimpleCXFNonSpringServlet.java')
-rw-r--r-- | cxfImplementations/SimpleCXFNonSpringServlet.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cxfImplementations/SimpleCXFNonSpringServlet.java b/cxfImplementations/SimpleCXFNonSpringServlet.java new file mode 100644 index 0000000..9f1399f --- /dev/null +++ b/cxfImplementations/SimpleCXFNonSpringServlet.java @@ -0,0 +1,48 @@ +package at.gv.egovernment.moa.spss.server.webservice.impl; + +import javax.servlet.ServletConfig; +import javax.xml.ws.Endpoint; + +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.transport.servlet.CXFNonSpringServlet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SimpleCXFNonSpringServlet extends CXFNonSpringServlet { + + private static final Logger logger = LoggerFactory.getLogger(SimpleCXFNonSpringServlet.class); + + /** + * + */ + private static final long serialVersionUID = 8564433272673970611L; + + @Override + public void loadBus(ServletConfig servletConfig) { + super.loadBus(servletConfig); + try { + Bus bus = getBus(); + bus.getInInterceptors().add(new PlainInputInterceptor()); + BusFactory.setDefaultBus(bus); + Endpoint signatureCreationEndpoint = Endpoint.publish("/SignatureCreation", + new SignatureCreationServiceImpl()); + if (signatureCreationEndpoint instanceof org.apache.cxf.endpoint.Endpoint) { + org.apache.cxf.endpoint.Endpoint cxfSignatureCreationEndpoint = (org.apache.cxf.endpoint.Endpoint) signatureCreationEndpoint; + cxfSignatureCreationEndpoint.getInInterceptors().add(new PlainInputInterceptor()); + } + signatureCreationEndpoint.getProperties().put("schema-validation-enabled", "true"); + Endpoint signatureVerificationEndpoint = Endpoint.publish("/SignatureVerification", + new SignatureVerificationServiceImpl()); + if (signatureVerificationEndpoint instanceof org.apache.cxf.endpoint.Endpoint) { + org.apache.cxf.endpoint.Endpoint cxfSignatureVerificationEndpoint = (org.apache.cxf.endpoint.Endpoint) signatureVerificationEndpoint; + cxfSignatureVerificationEndpoint.getInInterceptors().add(new PlainInputInterceptor()); + } + + //signatureVerificationEndpoint.getProperties().put("schema-validation-enabled", "true"); + } catch (Throwable e) { + logger.error("Failed to setup CXF", e); + } + } + +} |