owenb       2003/03/26 02:46:57

  Modified:    java/src/org/apache/wsif/util WSIFUtils.java
  Log:
  Add new readWSDL method that takes a WSDLLocator argument
  
  Revision  Changes    Path
  1.37      +33 -0     xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java
  
  Index: WSIFUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- WSIFUtils.java    14 Mar 2003 08:38:42 -0000      1.36
  +++ WSIFUtils.java    26 Mar 2003 10:46:57 -0000      1.37
  @@ -512,6 +512,39 @@
        * Read WSDL - it is different from a WSDLReader readWSDL method in that it
        * specifies the use of the WSIF WSDLFactory implementation which registers
        * the extensiblity elements used by the WSIF providers.
  +     * @param loc A WSDLLocator to use in locating the wsdl file and its imports
  +     * @throws WSDLException Exception thrown if wsdl cannot be read
  +     */
  +    public static Definition readWSDL(WSDLLocator loc)
  +        throws WSDLException {
  +        Trc.entry(null, loc);
  +        
  +        if (loc == null) {
  +             throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
  +                "Cannot use null WSDLLocator for reading wsdl");
  +        }
  +        
  +        initializeProviders();
  +
  +        WSDLFactory factory = WSDLFactory.newInstance(
  +            WSIFConstants.WSIF_WSDLFACTORY);
  +        WSDLReader wsdlReader = factory.newWSDLReader();
  +        wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
  +        try {
  +            Definition def = wsdlReader.readWSDL(loc);
  +            Trc.exitExpandWsdl(def);
  +            return def;
  +        } catch (WSDLException e) {
  +            Trc.exception(e);
  +            MessageLogger.log("WSIF.0002E", loc.getBaseURI());
  +            throw e;
  +        }
  +    }
  +
  +    /**
  +     * Read WSDL - it is different from a WSDLReader readWSDL method in that it
  +     * specifies the use of the WSIF WSDLFactory implementation which registers
  +     * the extensiblity elements used by the WSIF providers.
        * @param documentBase A URL for the document base URI for the wsdl
        * @param reader A Reader "pointing at" the wsdl file
        * @param cl A ClassLoader used to resolve relative imports when files are in
  
  
  

Reply via email to