1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.hl7v3;
17
18 import org.apache.cxf.frontend.ServerFactoryBean;
19 import org.apache.cxf.interceptor.InterceptorProvider;
20 import org.openehealth.ipf.commons.audit.AuditContext;
21 import org.openehealth.ipf.commons.ihe.core.atna.AuditStrategy;
22 import org.openehealth.ipf.commons.ihe.hl7v3.audit.Hl7v3AuditDataset;
23 import org.openehealth.ipf.commons.ihe.ws.JaxWsRequestServiceFactory;
24 import org.openehealth.ipf.commons.ihe.ws.cxf.WsRejectionHandlingStrategy;
25 import org.openehealth.ipf.commons.ihe.ws.cxf.databinding.plainxml.PlainXmlDataBinding;
26 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InNamespaceMergeInterceptor;
27 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InPayloadExtractorInterceptor;
28 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InPayloadInjectorInterceptor;
29
30 import static org.openehealth.ipf.commons.ihe.ws.cxf.payload.StringPayloadHolder.PayloadType.SOAP_BODY;
31
32
33
34
35
36
37 public class Hl7v3ServiceFactory extends JaxWsRequestServiceFactory<Hl7v3AuditDataset> {
38
39
40
41
42
43
44
45
46
47
48
49
50
51 public Hl7v3ServiceFactory(
52 Hl7v3WsTransactionConfiguration wsTransactionConfiguration,
53 String serviceAddress,
54 AuditStrategy<Hl7v3AuditDataset> auditStrategy,
55 AuditContext auditContext,
56 InterceptorProvider customInterceptors,
57 WsRejectionHandlingStrategy rejectionHandlingStrategy)
58 {
59 super(wsTransactionConfiguration, serviceAddress, auditStrategy, auditContext,
60 customInterceptors, rejectionHandlingStrategy);
61 }
62
63 @Override
64 protected void configureInterceptors(ServerFactoryBean svrFactory) {
65 svrFactory.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY));
66 svrFactory.getInInterceptors().add(new InNamespaceMergeInterceptor());
67 svrFactory.getInInterceptors().add(new InPayloadInjectorInterceptor(0));
68 svrFactory.setDataBinding(new PlainXmlDataBinding());
69
70 super.configureInterceptors(svrFactory);
71 }
72 }