View Javadoc

1   /*
2    * $Id: WSDDFileProvider.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.soap.axis.extensions;
12  
13  import javax.xml.namespace.QName;
14  
15  import org.apache.axis.ConfigurationException;
16  import org.apache.axis.configuration.FileProvider;
17  import org.apache.axis.handlers.soap.SOAPService;
18  
19  /**
20   * Override the File provider to stop exceptions being thrown in Axis if the service
21   * does not exist. Mule adds services after the WSDD has been loaded.
22   * 
23   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24   * @version $Revision: 7976 $
25   */
26  public class WSDDFileProvider extends FileProvider
27  {
28      /**
29       * Constructor which accesses a file in the current directory of the engine or at
30       * an absolute path.
31       */
32      public WSDDFileProvider(String filename)
33      {
34          super(filename);
35      }
36  
37      /**
38       * Constructor which accesses a file relative to a specific base path.
39       */
40      public WSDDFileProvider(String basepath, String filename) throws ConfigurationException
41      {
42          super(basepath, filename);
43      }
44  
45      /**
46       * retrieve an instance of the named service
47       * 
48       * @param qname the name of the service
49       * @return the service object or null if it doesn't exist
50       * @throws org.apache.axis.ConfigurationException
51       */
52      public SOAPService getService(QName qname) throws ConfigurationException
53      {
54          return getDeployment().getService(qname);
55      }
56  }