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