From e86d9677b16f54850cbd4c91c9f714754a75b67b Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Mon, 14 Mar 2016 16:29:25 +0100 Subject: CXF Webservice classes, excluded for now --- cxfImplementations/SimpleCXFNonSpringServlet.java | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cxfImplementations/SimpleCXFNonSpringServlet.java (limited to 'cxfImplementations/SimpleCXFNonSpringServlet.java') 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); + } + } + +} -- cgit v1.2.3