1 25 package org.objectweb.jonas.ws.axis; 26 27 import java.io.InputStream ; 28 import java.net.URL ; 29 import java.rmi.Remote ; 30 import java.util.Hashtable ; 31 import java.util.Map ; 32 import java.util.Properties ; 33 34 import javax.xml.namespace.QName ; 35 import javax.xml.rpc.Call ; 36 import javax.xml.rpc.ServiceException ; 37 38 import org.apache.axis.EngineConfiguration; 39 import org.apache.axis.client.Service; 40 import org.apache.axis.wsdl.gen.Parser; 41 42 47 public class JService extends Service { 48 49 53 private Map classname2wsdlPort = null; 54 55 58 private Hashtable mapCallProperties = new Hashtable (); 59 60 63 private Hashtable mapStubProperties = new Hashtable (); 64 65 68 public JService() { 69 super(); 70 } 71 72 75 public JService(QName serviceName) { 76 super(serviceName); 77 } 78 79 82 public JService(EngineConfiguration config) { 83 super(config); 84 } 85 86 90 public JService(URL wsdlDoc, QName serviceName) throws ServiceException { 91 super(wsdlDoc, serviceName); 92 } 93 94 98 public JService(Parser parser, QName serviceName) throws ServiceException { 99 super(parser, serviceName); 100 } 101 102 106 public JService(String wsdlLocation, QName serviceName) throws ServiceException { 107 super(wsdlLocation, serviceName); 108 } 109 110 114 public JService(InputStream wsdlInputStream, QName serviceName) throws ServiceException { 115 super(wsdlInputStream, serviceName); 116 } 117 118 121 public Remote getPort(Class proxyInterface) throws ServiceException { 122 if (this.classname2wsdlPort != null) { 123 QName portname = (QName ) this.classname2wsdlPort.get(proxyInterface.getName()); 124 if (portname != null) { 125 return getPort(portname, proxyInterface); 126 } else { 127 return super.getPort(proxyInterface); 128 } 129 } 130 return super.getPort(proxyInterface); 131 } 132 133 136 public Call createCall() throws ServiceException { 137 138 return new JCall(this); 139 } 140 141 145 public void assignSEIClassnameToWSDLPort(Map map) { 146 this.classname2wsdlPort = map; 147 } 148 149 153 public void assignCallProperties(String name, Properties callProperties) { 154 this.mapCallProperties.put(name, callProperties); 155 } 156 157 161 public void assignStubProperties(String name, Properties stubProperties) { 162 this.mapStubProperties.put(name, stubProperties); 163 } 164 165 169 public Properties getCallProperties(String name) { 170 Properties props = null; 171 if (mapCallProperties.containsKey(name)) { 172 props = (Properties ) mapCallProperties.get(name); 173 } 174 return props; 175 } 176 177 181 public Properties getStubProperties(String name) { 182 Properties props = null; 183 if (mapStubProperties.containsKey(name)) { 184 props = (Properties ) mapStubProperties.get(name); 185 } 186 return props; 187 } 188 189 } | Popular Tags |