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
15 import org.apache.cxf.aegis.databinding.AegisDatabinding;
16 import org.apache.cxf.endpoint.Client;
17 import org.apache.cxf.frontend.ClientProxy;
18 import org.apache.cxf.frontend.ClientProxyFactoryBean;
19
20 public class SimpleClientMessageProcessorBuilder extends AbstractClientMessageProcessorBuilder
21 {
22 @Override
23 protected Client createClient() throws CreateException, Exception
24 {
25 ClientProxyFactoryBean cpf = new ClientProxyFactoryBean();
26 cpf.setServiceClass(serviceClass);
27 if (databinding == null)
28 {
29 cpf.setDataBinding(new AegisDatabinding());
30 }
31 else
32 {
33 cpf.setDataBinding(databinding);
34 }
35 cpf.setAddress(getAddress());
36 cpf.setBus(getBus());
37 cpf.setProperties(properties);
38
39 if (wsdlLocation != null)
40 {
41 cpf.setWsdlLocation(wsdlLocation);
42 }
43
44 return ClientProxy.getClient(cpf.create());
45 }
46 }