KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > ws > axis > JAxisServiceFactory


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JAxisServiceFactory.java,v 1.26 2005/05/27 15:01:22 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.ws.axis;
27
28 import java.io.IOException JavaDoc;
29 import java.io.InputStream JavaDoc;
30 import java.io.StringWriter JavaDoc;
31 import java.lang.reflect.Constructor JavaDoc;
32 import java.lang.reflect.Proxy JavaDoc;
33 import java.net.URL JavaDoc;
34 import java.util.Hashtable JavaDoc;
35 import java.util.Iterator JavaDoc;
36 import java.util.List JavaDoc;
37 import java.util.Map JavaDoc;
38 import java.util.Properties JavaDoc;
39 import java.util.StringTokenizer JavaDoc;
40
41 import javax.naming.BinaryRefAddr JavaDoc;
42 import javax.naming.Context JavaDoc;
43 import javax.naming.InitialContext JavaDoc;
44 import javax.naming.Name JavaDoc;
45 import javax.naming.NamingException JavaDoc;
46 import javax.naming.RefAddr JavaDoc;
47 import javax.naming.Reference JavaDoc;
48 import javax.naming.StringRefAddr JavaDoc;
49 import javax.wsdl.Definition;
50 import javax.wsdl.Port;
51 import javax.wsdl.Service;
52 import javax.wsdl.extensions.ExtensibilityElement;
53 import javax.wsdl.extensions.soap.SOAPAddress;
54 import javax.wsdl.factory.WSDLFactory;
55 import javax.wsdl.xml.WSDLReader;
56 import javax.xml.namespace.QName JavaDoc;
57
58 import org.w3c.dom.Document JavaDoc;
59 import org.w3c.dom.Element JavaDoc;
60 import org.w3c.dom.NodeList JavaDoc;
61
62 import org.apache.axis.EngineConfiguration;
63 import org.apache.axis.client.AxisClient;
64 import org.apache.axis.configuration.XMLStringProvider;
65 import org.apache.axis.deployment.wsdd.WSDDConstants;
66 import org.apache.axis.deployment.wsdd.WSDDProvider;
67 import org.apache.axis.utils.XMLUtils;
68 import org.apache.axis.wsdl.toJava.Utils;
69
70 import org.objectweb.jonas_lib.I18n;
71 import org.objectweb.jonas_lib.xml.XMLSerializer;
72
73 import org.objectweb.jonas_ws.deployment.api.MappingFile;
74 import org.objectweb.jonas_ws.deployment.api.PortComponentDesc;
75 import org.objectweb.jonas_ws.deployment.api.PortComponentRefDesc;
76 import org.objectweb.jonas_ws.deployment.api.ServiceRefDesc;
77
78 import org.objectweb.jonas.common.JNDIUtils;
79 import org.objectweb.jonas.common.Log;
80 import org.objectweb.jonas.ws.JServiceFactory;
81 import org.objectweb.jonas.ws.WSServiceException;
82
83 import org.objectweb.util.monolog.api.BasicLevel;
84 import org.objectweb.util.monolog.api.Logger;
85
86 /**
87  * Axis specific JServiceFactory. Create an Axis Service Reference. Used to
88  * recreate Axis Service bound in JNDI (ObjectFactory)
89  * @author Guillaume Sauthier
90  * @author Xavier Delplanque
91  */

92 public class JAxisServiceFactory implements JServiceFactory {
93
94
95     /** logger */
96     private static Logger logger = Log.getLogger(Log.JONAS_WS_PREFIX);
97
98     /** i18n instance */
99     private static I18n i18n = I18n.getInstance(JAxisServiceFactory.class);
100
101     /** The jonas-init-param name for client configuration file */
102     private static final String JavaDoc AXIS_CLIENT_CONFIG_PARAM = "axis.clientConfigFile";
103
104     /** default client configuration file to be filled */
105     private static final String JavaDoc CLIENT_CONFIG_WSDD = "org/objectweb/jonas/ws/axis/client-config.wsdd";
106
107     /** Service Implementation in JOnAS */
108     private static final String JavaDoc JONAS_SERVICE_CLASSNAME = "org.objectweb.jonas.ws.axis.JService";
109
110     // ======================================================================
111

112     /**
113      * Ref name for client-config wsdd
114      */

115     public static final String JavaDoc REF_CLIENT_CONFIG = "client.config.wsdd";
116
117     /**
118      * Ref name for the service WSDL URL
119      */

120     public static final String JavaDoc REF_SERVICE_WSDL = "service.wsdl.url";
121
122     /**
123      * Ref name for the service QName
124      */

125     public static final String JavaDoc REF_SERVICE_QNAME = "service.qname";
126
127     /**
128      * Ref name for a Map linking service-endpoint-interface (from port-component) to wsdl:port
129      */

130     public static final String JavaDoc REF_SERVICE_PORT2WSDL = "port.2.wsdl.map";
131
132     /**
133      * Ref name for the service call properties
134      */

135     public static final String JavaDoc REF_SERVICE_CALL_PROPS = "service.call.properties";
136
137     /**
138      * Ref name for the service call properties
139      */

140     public static final String JavaDoc REF_SERVICE_STUB_PROPS = "service.stub.properties";
141
142     /**
143      * Ref name for the service port list
144      */

145     public static final String JavaDoc REF_SERVICE_WSDL_PORT_LIST = "service.port.list";
146
147     /**
148      * setEndpointAddress method signature
149      */

150     private static final Class JavaDoc[] SETENDPOINTADDRESS_SIG = new Class JavaDoc[] {java.lang.String JavaDoc.class, java.lang.String JavaDoc.class };
151
152     // ======================================================================
153

154     /**
155      * Construct a new JAxisServiceFactory.
156      */

157     public JAxisServiceFactory() {
158         QName JavaDoc javaURI = new QName JavaDoc(WSDDConstants.URI_WSDD_JAVA, WSDDNoopProvider.PROVIDER_NAME);
159         WSDDProvider.registerProvider(javaURI, new WSDDNoopProvider());
160     }
161
162     /**
163      * Create a Reference on a Service from an Axis Service object.
164      * @param sr the service-ref instance where informations are extracted
165      * @param cl the classloader where config files can be loaded
166      * @return a Reference on a Service from an Axis Service object.
167      * @throws WSServiceException if wsdd cannot be load or merged
168      */

169     public Reference JavaDoc getServiceReference(ServiceRefDesc sr, ClassLoader JavaDoc cl) throws WSServiceException {
170
171         String JavaDoc classname = createServiceClassname(sr);
172
173         logger.log(BasicLevel.DEBUG, "Service classname: '" + classname + "'");
174
175         // Create a reference on the Service class (generated or not)
176
Reference JavaDoc ref = new Reference JavaDoc(classname, getClass().getName(), null);
177
178         Document JavaDoc base = loadAxisDeployment(CLIENT_CONFIG_WSDD, cl);
179
180         // get the WSDD configuration
181
String JavaDoc clientConfig = sr.getParam(AXIS_CLIENT_CONFIG_PARAM);
182
183         // If ServiceRef has a specified ConfigFile
184
if (clientConfig != null) {
185             // load wsdd
186
Document JavaDoc doc = loadAxisDeployment(clientConfig, cl);
187
188             // merge
189
mergeAxisDeployment(base, doc);
190         }
191
192         // 1. client.wsdd
193
String JavaDoc str = null;
194         try {
195             str = serializeDOM(base);
196             if (logger.isLoggable(BasicLevel.DEBUG)) {
197                 logger.log(BasicLevel.DEBUG, "Client Descriptor file : \n" + str);
198             }
199         } catch (IOException JavaDoc ioe) {
200             throw new WSServiceException("Cannot serialize Document", ioe);
201         }
202         ref.add(new StringRefAddr JavaDoc(REF_CLIENT_CONFIG, str));
203
204         //2. manage port-component-link
205
for (Iterator JavaDoc i = sr.getPortComponentRefs().iterator(); i.hasNext();) {
206             PortComponentRefDesc pcr = (PortComponentRefDesc) i.next();
207             PortComponentDesc referencedPortComponent = pcr.getPortComponentDesc();
208
209             // port has a link on a local port
210
if (referencedPortComponent != null) {
211
212                 logger.log(BasicLevel.DEBUG, "Find a port-component-link in port-component-ref" + pcr.getSEI());
213                 // Get the Service WSDL URL !!!
214
URL JavaDoc url = referencedPortComponent.getEndpointURL();
215                 if (url == null) {
216                     // Component outside JOnAS server
217
// lookup endpoint URL value
218
try {
219                         Context JavaDoc ic = new InitialContext JavaDoc();
220                         url = (URL JavaDoc) ic.lookup(referencedPortComponent.getName());
221                     } catch (NamingException JavaDoc ne) {
222                         throw new WSServiceException("Cannot find updated endpoint for port-component '"
223                                 + referencedPortComponent.getName() + "'", ne);
224                     }
225                 }
226
227                 logger.log(BasicLevel.DEBUG, "Uptodate URL : '" + url + "?JWSDL' ");
228                 ref.add(new StringRefAddr JavaDoc(REF_SERVICE_WSDL, url.toExternalForm() + "?JWSDL"));
229             }
230         }
231
232         // 3. service wsdl URL
233
if (sr.getAlternateWsdlURL() != null) {
234             logger.log(BasicLevel.DEBUG, "Using alternate WSDL URL : '" + sr.getAlternateWsdlURL() + "'");
235             ref.add(new StringRefAddr JavaDoc(REF_SERVICE_WSDL, sr.getAlternateWsdlURL().toString()));
236         } else if (sr.getLocalWSDLURL() != null) {
237             logger.log(BasicLevel.DEBUG, "Using WSDL URL : '" + sr.getLocalWSDLURL() + "'");
238             ref.add(new StringRefAddr JavaDoc(REF_SERVICE_WSDL, sr.getLocalWSDLURL().toExternalForm()));
239         }
240
241         // 4. Service QName
242
if (sr.getServiceQName() != null) {
243             ref.add(new BinaryRefAddr JavaDoc(REF_SERVICE_QNAME, JNDIUtils.getBytesFromObject(sr.getServiceQName())));
244         }
245
246         // 5. classname -> wsdl:port map
247
List JavaDoc ports = sr.getPortComponentRefs();
248         if (!ports.isEmpty()) {
249             Map JavaDoc map = new Hashtable JavaDoc();
250             for (Iterator JavaDoc i = ports.iterator(); i.hasNext();) {
251                 PortComponentRefDesc pcrd = (PortComponentRefDesc) i.next();
252                 QName JavaDoc wsdlPort = pcrd.getWsdlPort();
253                 if (wsdlPort != null) {
254                     map.put(pcrd.getSEI().getName(), wsdlPort);
255                 }
256             }
257             if (!map.isEmpty()) {
258                 ref.add(new BinaryRefAddr JavaDoc(REF_SERVICE_PORT2WSDL, JNDIUtils.getBytesFromObject(map)));
259             }
260         }
261
262         // 6. store call & stubs properties
263
String JavaDoc portNames = null;
264         for (Iterator JavaDoc i = sr.getPortComponentRefs().iterator(); i.hasNext();) {
265             PortComponentRefDesc pcr = (PortComponentRefDesc) i.next();
266             Properties JavaDoc cProps = pcr.getCallProperties();
267             Properties JavaDoc sProps = pcr.getStubProperties();
268
269             if (pcr.getWsdlPort() != null) {
270                 // use call & stub property only if there is a wsdl:port for applying to
271
// TODO must be something to add into documentation for this
272
String JavaDoc name = pcr.getWsdlPort().getLocalPart();
273                 if (!cProps.isEmpty()) {
274                     ref.add(new BinaryRefAddr JavaDoc(REF_SERVICE_CALL_PROPS + "_" + name, JNDIUtils
275                                     .getBytesFromObject(cProps)));
276                 }
277                 if (!sProps.isEmpty()) {
278                     ref.add(new BinaryRefAddr JavaDoc(REF_SERVICE_STUB_PROPS + "_" + name, JNDIUtils
279                                     .getBytesFromObject(sProps)));
280                 }
281                 if (!sProps.isEmpty() || !cProps.isEmpty()) {
282                     if (portNames != null) {
283                         // only the first addition does not need a comma
284
portNames += "," + name;
285                     } else {
286                         portNames = name;
287                     }
288                 }
289             }
290         }
291         if (portNames != null) {
292             ref.add(new StringRefAddr JavaDoc(REF_SERVICE_WSDL_PORT_LIST, portNames));
293         }
294
295         return ref;
296     }
297
298     /**
299      * @param base the Document to serialize
300      * @return Returns a String representation of the given XML Document
301      * @throws IOException when Serializer cannot proceed
302      */

303     private String JavaDoc serializeDOM(Document JavaDoc base) throws IOException JavaDoc {
304         StringWriter JavaDoc sw = new StringWriter JavaDoc();
305         XMLSerializer ser = new XMLSerializer(base);
306         ser.serialize(sw);
307         return sw.getBuffer().toString();
308     }
309
310     /**
311      * @param base father Document
312      * @param doc Document that will be incorpored inside base Document
313      */

314     private void mergeAxisDeployment(Document JavaDoc base, Document JavaDoc doc) {
315         Element importedDeploymentElement = (Element) base.importNode(doc.getDocumentElement(), true);
316         NodeList JavaDoc list = importedDeploymentElement.getChildNodes();
317         // append each Element childnodes
318
for (int i = 0; i < list.getLength(); i++) {
319             if (list.item(i) instanceof Element) {
320                 base.getDocumentElement().appendChild(list.item(i));
321             }
322         }
323     }
324
325     /**
326      * Create the Axis Service Implementation class name from the QName (if
327      * generated interface found).
328      * TODO Use jaxrpc mapping information if available !
329      * @param sr the service-ref storing service informations
330      * @return the fully qualified Service implementation classname.
331      */

332     private String JavaDoc createServiceClassname(ServiceRefDesc sr) {
333
334         String JavaDoc intfName = sr.getServiceInterface().getName();
335
336         if (intfName.equals("javax.xml.rpc.Service")) {
337             // no generated class
338
return JONAS_SERVICE_CLASSNAME;
339         } else {
340             // generated class
341
QName JavaDoc qn = sr.getServiceQName();
342             MappingFile mf = sr.getMappingFile();
343
344             String JavaDoc p = (String JavaDoc) mf.getMappings().get(qn.getNamespaceURI());
345
346             String JavaDoc classname = "";
347             if (p != null) {
348                 classname = p + "." + Utils.xmlNameToJavaClass(qn.getLocalPart()) + "Locator";
349             } else {
350                 classname = Utils.xmlNameToJavaClass(qn.getLocalPart()) + "Locator";
351             }
352
353             return classname;
354         }
355
356     }
357
358     /**
359      * Load the Axis Deployment Descriptor from the ClassLoader.
360      * @param filename the resource name to load
361      * @param cl The ClassLoader used to load the WSDD
362      * @return the Document Axis Deployment Descriptor from the ClassLoader.
363      * @throws WSServiceException if resource could not be found or if XML
364      * Document cannot be created
365      */

366     private Document JavaDoc loadAxisDeployment(String JavaDoc filename, ClassLoader JavaDoc cl) throws WSServiceException {
367
368         InputStream JavaDoc is = cl.getResourceAsStream(filename);
369
370         //logger.log(BasicLevel.DEBUG, "classloader : " + cl);
371

372         if (is == null) {
373             // exception !
374
String JavaDoc err = i18n.getMessage("JAxisServiceFactory.loadAxisDeployment.configNotFound", filename);
375             logger.log(BasicLevel.ERROR, err);
376             throw new WSServiceException(err);
377         }
378
379         Document JavaDoc doc = null;
380         try {
381             doc = XMLUtils.newDocument(is);
382         } catch (Exception JavaDoc e) {
383             String JavaDoc err = i18n.getMessage("JAxisServiceFactory.loadAxisDeployment.docCreation", filename);
384             logger.log(BasicLevel.DEBUG, err);
385
386             throw new WSServiceException(err, e);
387         }
388
389         return doc;
390     }
391
392     /**
393      * Create a new instance of Axis Service (or sub classes) from a Reference
394      * object.
395      * @param refObject the Reference to create an instance from
396      * @param name Object Name
397      * @param nameCtx Context
398      * @param env the environnment
399      * @return A Service instance configured
400      * @throws Exception when instanciation fail (check if this is a correct
401      * behavior !!!)
402      */

403     public Object JavaDoc getObjectInstance(Object JavaDoc refObject, Name JavaDoc name, Context JavaDoc nameCtx, Hashtable JavaDoc env) throws Exception JavaDoc {
404
405         JService instance = null;
406         Object JavaDoc proxy = null;
407
408         if (refObject instanceof Reference JavaDoc) {
409             Reference JavaDoc ref = (Reference JavaDoc) refObject;
410
411             // get ClassLoader
412
ClassLoader JavaDoc cl = Thread.currentThread().getContextClassLoader();
413             logger.log(BasicLevel.DEBUG, "Context ClassLoader : " + cl);
414
415             // get Class
416
Class JavaDoc serviceClass = cl.loadClass(ref.getClassName());
417
418             // new Service
419
BinaryRefAddr JavaDoc bRefQname = (BinaryRefAddr JavaDoc) ref.get(REF_SERVICE_QNAME);
420
421             QName JavaDoc serviceQname = null;
422             if (bRefQname != null) {
423                 serviceQname = (QName JavaDoc) JNDIUtils.getObjectFromBytes((byte[]) bRefQname.getContent());
424             }
425
426             RefAddr JavaDoc refServiceWSDL = ref.get(REF_SERVICE_WSDL);
427
428             String JavaDoc serviceWsdl = null;
429             if (refServiceWSDL != null) {
430                 serviceWsdl = (String JavaDoc) refServiceWSDL.getContent();
431             }
432
433             // Prefill as much as we can
434
if (JONAS_SERVICE_CLASSNAME.equals(serviceClass.getName())) {
435
436                 // default service class
437
logger.log(BasicLevel.DEBUG, "default service class");
438
439                 if ((serviceQname == null) && (serviceWsdl == null)) {
440                     logger.log(BasicLevel.DEBUG, "Create a new Service instance without params");
441                     // no param instance
442
instance = new JService();
443
444                 } else if ((serviceQname != null) && (serviceWsdl == null)) {
445                     logger.log(BasicLevel.DEBUG, "Create a new Service instance with only a QName " + serviceQname);
446                     // serviceQname only
447
instance = new JService(serviceQname);
448
449                 } else if ((serviceQname != null) && (serviceWsdl != null)) {
450                     logger.log(BasicLevel.DEBUG, "Create a new Service instance with QName " + serviceQname
451                             + "and WSDL " + serviceWsdl);
452                     // serviceQname + wsdl
453
instance = new JService(serviceWsdl, serviceQname);
454
455                 } else {
456                     logger.log(BasicLevel.DEBUG, "Create a new Service instance with WSDL " + serviceWsdl);
457                     logger.log(BasicLevel.DEBUG, "Should not occurs !!!");
458                     // wsdl
459
// serviceWsdl, updatedURLs, serviceQname);
460
instance = new JService();
461                 }
462
463             } else {
464                 logger.log(BasicLevel.DEBUG, "Create a new Generated Service instance");
465                 logger.log(BasicLevel.DEBUG, "serviceWSDL:" + serviceWsdl + " serviceQName:" + serviceQname);
466
467                 // generated class
468
Constructor JavaDoc ctr = serviceClass.getConstructor(new Class JavaDoc[] {String JavaDoc.class, QName JavaDoc.class});
469                 instance = (JService) ctr.newInstance(new Object JavaDoc[] {serviceWsdl, serviceQname});
470
471                 // we have to update ports endpoints
472
// we should have Service WSDL
473
// otherwise, no Generated WSDL !
474
if (serviceWsdl != null) {
475                     WSDLFactory factory = WSDLFactory.newInstance();
476                     WSDLReader reader = factory.newWSDLReader();
477                     reader.setFeature("javax.wsdl.importDocuments", true);
478                     Definition def = reader.readWSDL(serviceWsdl);
479
480                     Service service = def.getService(serviceQname);
481                     Map JavaDoc ports = service.getPorts();
482                     java.lang.reflect.Method JavaDoc m = serviceClass.getMethod("setEndpointAddress", SETENDPOINTADDRESS_SIG);
483                     for (Iterator JavaDoc i = ports.keySet().iterator(); i.hasNext();) {
484                         String JavaDoc portName = (String JavaDoc) i.next();
485                         Port port = service.getPort(portName);
486                         String JavaDoc endpoint = getSOAPLocation(port);
487                         m.invoke(instance, new Object JavaDoc[] {port.getName(), endpoint });
488                     }
489                 }
490             }
491
492             // get port2wsdl map
493
BinaryRefAddr JavaDoc bRefp2w = (BinaryRefAddr JavaDoc) ref.get(REF_SERVICE_PORT2WSDL);
494
495             if (bRefp2w != null) {
496                 Map JavaDoc map = (Map JavaDoc) JNDIUtils.getObjectFromBytes((byte[]) bRefp2w.getContent());
497                 instance.assignSEIClassnameToWSDLPort(map);
498             }
499
500             // get WSDL_PORT_NAMES
501
RefAddr JavaDoc portsRef = ref.get(REF_SERVICE_WSDL_PORT_LIST);
502             String JavaDoc listPorts = null;
503             if (portsRef != null) {
504                 listPorts = (String JavaDoc) portsRef.getContent();
505
506                 if (listPorts != null) {
507                     // get call properties
508
StringTokenizer JavaDoc strPort = new StringTokenizer JavaDoc(listPorts, ",");
509                     while (strPort.hasMoreTokens()) {
510                         String JavaDoc port = strPort.nextToken();
511
512                         // call properties
513
BinaryRefAddr JavaDoc bRefcp = (BinaryRefAddr JavaDoc) ref.get(REF_SERVICE_CALL_PROPS + "_" + port);
514
515                         if (bRefcp != null) {
516                             Properties JavaDoc callProperties = (Properties JavaDoc) JNDIUtils.getObjectFromBytes((byte[]) bRefcp.getContent());
517                             instance.assignCallProperties(port, callProperties);
518                         }
519
520                         // stub properties
521
BinaryRefAddr JavaDoc bRefsp = (BinaryRefAddr JavaDoc) ref.get(REF_SERVICE_STUB_PROPS + "_" + port);
522
523                         if (bRefsp != null) {
524                             Properties JavaDoc stubProperties = (Properties JavaDoc) JNDIUtils.getObjectFromBytes((byte[]) bRefsp.getContent());
525                             instance.assignStubProperties(port, stubProperties);
526                         }
527                     }
528                 }
529             }
530             EngineConfiguration ec = getConfiguration(ref);
531
532             // configure the instance
533
instance.setEngine(new AxisClient(ec));
534
535             JServiceProxy handler = new JServiceProxy(instance);
536             Class JavaDoc[] serviceInterfaces = serviceClass.getInterfaces();
537             Class JavaDoc[] interfaces = new Class JavaDoc[serviceInterfaces.length + 1];
538             for (int i = 0; i < serviceInterfaces.length; i++) {
539                 interfaces[i] = serviceInterfaces[i];
540             }
541             interfaces[serviceInterfaces.length] = javax.xml.rpc.Service JavaDoc.class;
542             proxy = Proxy.newProxyInstance(cl, interfaces, handler);
543
544         }
545
546         return proxy;
547     }
548
549     /**
550      * @param port analyzed port
551      * @return Returns the endpoint URL of the given Port
552      */

553     private String JavaDoc getSOAPLocation(Port port) {
554         String JavaDoc endpoint = null;
555         List JavaDoc extensions = port.getExtensibilityElements();
556         for (Iterator JavaDoc i = extensions.iterator(); i.hasNext();) {
557             ExtensibilityElement ext = (ExtensibilityElement) i.next();
558             if (ext instanceof SOAPAddress) {
559                 SOAPAddress addr = (SOAPAddress) ext;
560                 endpoint = addr.getLocationURI();
561             }
562         }
563         return endpoint;
564     }
565
566     /**
567      * Return the EngineConfiguration object found in the Reference
568      * @param ref The reference to an Axis Service instance
569      * @return the EngineConfiguration object found in the Reference
570      * @throws Exception when content of reference is not a valid WSDD
571      */

572     private EngineConfiguration getConfiguration(Reference JavaDoc ref) throws Exception JavaDoc {
573         // create a Configuration Object
574
String JavaDoc conf = (String JavaDoc) ref.get(REF_CLIENT_CONFIG).getContent();
575         logger.log(BasicLevel.DEBUG, "loaded configuration : " + conf);
576         return new XMLStringProvider(conf);
577     }
578
579 }
Popular Tags