1 28 29 package com.caucho.soap.jaxrpc; 30 31 import com.caucho.log.Log; 32 import com.caucho.soap.wsdl.WSDLDefinitions; 33 import com.caucho.soap.wsdl.WSDLParser; 34 import com.caucho.util.L10N; 35 36 import javax.xml.namespace.QName ; 37 import javax.xml.rpc.Service ; 38 import javax.xml.rpc.ServiceException ; 39 import javax.xml.rpc.ServiceFactory ; 40 import java.io.InputStream ; 41 import java.net.URL ; 42 import java.util.Properties ; 43 import java.util.logging.Logger ; 44 45 48 public class ServiceFactoryImpl extends ServiceFactory { 49 private final static Logger log = Log.open(ServiceFactoryImpl.class); 50 private final static L10N L = new L10N(ServiceFactoryImpl.class); 51 52 55 public Service createService(QName serviceName) 56 { 57 return new ServiceImpl(serviceName); 58 } 59 60 63 public Service createService(URL wsdl, QName serviceName) 64 throws ServiceException 65 { 66 77 throw new UnsupportedOperationException (); 78 } 79 80 83 public Service loadService(Class serviceInterface) 84 { 85 throw new UnsupportedOperationException (); 86 } 87 88 91 public Service loadService(URL wsdl, 92 Class serviceInterface, 93 Properties properties) 94 throws ServiceException 95 { 96 parseWSDL(wsdl); 97 98 return new ServiceImpl((QName ) null); 99 } 100 101 104 public Service loadService(URL wsdl, 105 QName serviceName, 106 Properties properties) 107 throws ServiceException 108 { 109 parseWSDL(wsdl); 110 111 return new ServiceImpl(serviceName); 112 } 113 114 117 private WSDLDefinitions parseWSDL(URL wsdl) 118 throws ServiceException 119 { 120 try { 121 InputStream is = wsdl.openStream(); 122 try { 123 return WSDLParser.parse(is); 124 } finally { 125 is.close(); 126 } 127 } catch (Exception e) { 128 throw new ServiceException (e); 129 } 130 } 131 132 135 public String toString() 136 { 137 return "ServiceFactoryImpl[]"; 138 } 139 } 140 141 142 | Popular Tags |