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.endpoint.Client;
19 import org.apache.cxf.feature.AbstractFeature;
20 import org.apache.cxf.interceptor.InterceptorProvider;
21 import org.openehealth.ipf.commons.audit.AuditContext;
22 import org.openehealth.ipf.commons.ihe.core.atna.AuditStrategy;
23 import org.openehealth.ipf.commons.ihe.hl7v3.audit.Hl7v3AuditDataset;
24 import org.openehealth.ipf.commons.ihe.ws.JaxWsRequestClientFactory;
25 import org.openehealth.ipf.commons.ihe.ws.correlation.AsynchronyCorrelator;
26 import org.openehealth.ipf.commons.ihe.ws.cxf.databinding.plainxml.PlainXmlDataBinding;
27 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InNamespaceMergeInterceptor;
28 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InPayloadExtractorInterceptor;
29 import org.openehealth.ipf.commons.ihe.ws.cxf.payload.InPayloadInjectorInterceptor;
30
31 import java.util.List;
32 import java.util.Map;
33
34 import static org.openehealth.ipf.commons.ihe.ws.cxf.payload.StringPayloadHolder.PayloadType.SOAP_BODY;
35
36
37
38
39
40 public class Hl7v3ClientFactory extends JaxWsRequestClientFactory<Hl7v3AuditDataset> {
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 public Hl7v3ClientFactory(
56 Hl7v3WsTransactionConfiguration wsTransactionConfiguration,
57 String serviceUrl,
58 AuditStrategy<Hl7v3AuditDataset> auditStrategy,
59 AuditContext auditContext,
60 InterceptorProvider customInterceptors,
61 List<AbstractFeature> features,
62 Map<String, Object> properties,
63 AsynchronyCorrelator<Hl7v3AuditDataset> correlator)
64 {
65 super(wsTransactionConfiguration, serviceUrl, auditStrategy, auditContext,
66 customInterceptors, features, properties, correlator);
67 }
68
69 @Override
70 protected void configureInterceptors(Client client) {
71 super.configureInterceptors(client);
72
73 client.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY));
74 client.getInInterceptors().add(new InNamespaceMergeInterceptor());
75 client.getInInterceptors().add(new InPayloadInjectorInterceptor(0));
76 client.getEndpoint().getService().setDataBinding(new PlainXmlDataBinding());
77 }
78 }