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