1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.cxf.builder;
12
13 import org.mule.api.lifecycle.CreateException;
14 import org.mule.module.cxf.support.CxfUtils;
15
16 import org.apache.cxf.aegis.databinding.AegisDatabinding;
17 import org.apache.cxf.endpoint.Client;
18 import org.apache.cxf.frontend.ClientProxy;
19 import org.apache.cxf.frontend.ClientProxyFactoryBean;
20
21 public class SimpleClientMessageProcessorBuilder extends AbstractClientMessageProcessorBuilder
22 {
23 @Override
24 protected Client createClient() throws CreateException, Exception
25 {
26 ClientProxyFactoryBean cpf = new ClientProxyFactoryBean();
27 cpf.setServiceClass(serviceClass);
28 if (databinding == null)
29 {
30 cpf.setDataBinding(new AegisDatabinding());
31 }
32 else
33 {
34 cpf.setDataBinding(databinding);
35 }
36 cpf.setAddress(getAddress());
37 cpf.setBus(getBus());
38 cpf.setProperties(properties);
39
40 if (wsdlLocation != null)
41 {
42 cpf.setWsdlLocation(wsdlLocation);
43 }
44
45
46 if(soapVersion != null)
47 {
48 cpf.setBindingId(CxfUtils.getBindingIdForSoapVersion(soapVersion));
49 }
50
51 return ClientProxy.getClient(cpf.create());
52 }
53 }