1 package org.kuali.ole.select.document.service.impl;
2
3 import org.apache.cxf.frontend.ClientProxyFactoryBean;
4 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
5 import org.kuali.ole.select.document.service.OleWebServiceProvider;
6
7 import javax.xml.namespace.QName;
8
9
10
11
12
13
14
15
16 public class OleWebServiceProviderImpl implements OleWebServiceProvider {
17 private ClientProxyFactoryBean clientFactory = null;
18
19 @Override
20 public Object getService(String serviceClassName, String serviceName, String serviceURL) {
21 try {
22 clientFactory = new JaxWsProxyFactoryBean();
23 clientFactory.setServiceClass(Class.forName(serviceClassName));
24 } catch (ClassNotFoundException e) {
25 throw new RuntimeException("Failed to connect to soap service because failed to load interface class: " + serviceClassName, e);
26 }
27 QName namespaceURI = new QName("http://service.select.ole.kuali.org/", serviceName);
28 clientFactory.setServiceName(namespaceURI);
29 clientFactory.setAddress(serviceURL);
30 Object service = clientFactory.create();
31 return service;
32 }
33 }