diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2016-03-14 16:29:25 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2016-03-14 16:29:25 +0100 |
commit | e86d9677b16f54850cbd4c91c9f714754a75b67b (patch) | |
tree | 64d08dac31e6ff40e690139af9d6728bacdbd508 /cxfImplementations/SimpleCXFNonSpringServlet.java | |
parent | 84293bd12f63b59852026cab02035fc9ebee626a (diff) | |
download | moa-sig-e86d9677b16f54850cbd4c91c9f714754a75b67b.tar.gz moa-sig-e86d9677b16f54850cbd4c91c9f714754a75b67b.tar.bz2 moa-sig-e86d9677b16f54850cbd4c91c9f714754a75b67b.zip |
CXF Webservice classes, excluded for now
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); + } + } + +} |