You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2002/10/10 21:56:46 UTC

cvs commit: xml-axis/java/test/wsdl/sequence SequenceService.java

scheu       2002/10/10 12:56:46

  Modified:    java/src/org/apache/axis AxisFault.java
               java/src/org/apache/axis/client Service.java
               java/src/org/apache/axis/deployment/wsdd WSDDDocument.java
               java/src/org/apache/axis/handlers EchoHandler.java
               java/src/org/apache/axis/message SOAPBodyElement.java
                        Text.java
               java/src/org/apache/axis/utils Admin.java XMLUtils.java
               java/src/org/apache/axis/wsdl/fromJava Emitter.java
                        Types.java
               java/src/org/apache/axis/wsdl/gen Parser.java
               java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
               java/src/org/apache/axis/wsdl/toJava Emitter.java
               java/test/utils TestXMLUtils.java
               java/test/wsdl/import3/MultiImpIncl CompoGlobals.xsd
               java/test/wsdl/inheritance InheritanceTestCase.java
               java/test/wsdl/sequence SequenceService.java
  Log:
  Problem: The XMLUtils.newDocument(..) methods are swallowing exceptions.
           Thus crucial information about why the document could not be created
           (i.e. file not found, connection problems, xml syntax errors) is lost.
  
  Solution:  I changed the code so that the exceptions are not swallowed.
           The XMLUtils.newDocument(...) signatures now define the exceptions that
           are thrown.  These signature changes forced similar changes up through
           the runtime and emitters.
  
  This change will certainly be appreciated by our users  :-)
  
  Revision  Changes    Path
  1.60      +23 -11    xml-axis/java/src/org/apache/axis/AxisFault.java
  
  Index: AxisFault.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisFault.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- AxisFault.java	8 Oct 2002 03:31:32 -0000	1.59
  +++ AxisFault.java	10 Oct 2002 19:56:44 -0000	1.60
  @@ -62,6 +62,7 @@
   import org.apache.axis.message.SOAPHeaderElement;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
  +import org.apache.axis.utils.Messages;
   import org.apache.commons.logging.Log;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -73,6 +74,7 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Vector;
  +import javax.xml.parsers.ParserConfigurationException;
   
   /**
    * An exception which maps cleanly to a SOAP fault.
  @@ -282,21 +284,31 @@
   
       public void setFaultDetailString(String details) {
           faultDetails = new Vector();
  -        Document doc = XMLUtils.newDocument();
  -        Element element = doc.createElement("string");
  -        Text text = doc.createTextNode(details);
  -        element.appendChild(text);
  -        faultDetails.add(element);
  +        try {
  +            Document doc = XMLUtils.newDocument();
  +            Element element = doc.createElement("string");
  +            Text text = doc.createTextNode(details);
  +            element.appendChild(text);
  +            faultDetails.add(element);
  +        } catch (ParserConfigurationException e) {
  +            // This should not occur
  +            throw new InternalException(e);
  +        }
       }
   
       public void addFaultDetailString(String detail) {
           if(faultDetails == null)
  -            faultDetails = new Vector();
  -        Document doc = XMLUtils.newDocument();
  -        Element element = doc.createElement("string");
  -        Text text = doc.createTextNode(detail);
  -        element.appendChild(text);
  -        faultDetails.add(element);
  +            faultDetails = new Vector(); 
  +        try {
  +            Document doc = XMLUtils.newDocument();
  +            Element element = doc.createElement("string");
  +            Text text = doc.createTextNode(detail);
  +            element.appendChild(text);
  +            faultDetails.add(element);
  +        } catch (ParserConfigurationException e) {
  +            // This should not occur
  +            throw new InternalException(e);
  +        }
       }
   
       public Element[] getFaultDetails() {
  
  
  
  1.78      +22 -4     xml-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Service.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- Service.java	8 Oct 2002 03:31:32 -0000	1.77
  +++ Service.java	10 Oct 2002 19:56:44 -0000	1.78
  @@ -192,8 +192,14 @@
             initService( def, serviceName );
           }
           else {
  -          Document doc = XMLUtils.newDocument(wsdlDoc.toString());
  -          initService(doc, serviceName);
  +            Document doc = null;
  +            try {
  +                doc = XMLUtils.newDocument(wsdlDoc.toString());
  +            } catch (Exception exp ) {
  +                throw new ServiceException(
  +                   Messages.getMessage("wsdlError00", "" + "", "\n" + exp) );
  +            }
  +            initService(doc, serviceName);
           }
       }
   
  @@ -224,7 +230,13 @@
             initService( def, serviceName );
           }
           else {
  -          Document doc = XMLUtils.newDocument(this.wsdlLocation.toString());
  +            Document doc = null;
  +            try {
  +                doc = XMLUtils.newDocument(this.wsdlLocation.toString());
  +            } catch (Exception exp ) {
  +                throw new ServiceException(
  +                   Messages.getMessage("wsdlError00", "" + "", "\n" + exp) );
  +            }
             initService(doc, serviceName);
           }
       }
  @@ -242,7 +254,13 @@
       public Service(InputStream wsdlInputStream, QName serviceName)
                              throws ServiceException {
           engine = getAxisClient();
  -        Document doc = XMLUtils.newDocument(wsdlInputStream);
  +        Document doc = null;
  +        try {
  +            doc = XMLUtils.newDocument(wsdlInputStream);
  +        } catch (Exception exp ) {
  +            throw new ServiceException(
  +               Messages.getMessage("wsdlError00", "" + "", "\n" + exp) );
  +        }
           initService(doc, serviceName);
       }
   
  
  
  
  1.32      +1 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDocument.java
  
  Index: WSDDDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDocument.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- WSDDDocument.java	18 Sep 2002 16:10:39 -0000	1.31
  +++ WSDDDocument.java	10 Oct 2002 19:56:44 -0000	1.32
  @@ -145,7 +145,7 @@
           try {
               writer.close();
               return XMLUtils.newDocument(new InputSource(new StringReader(writer.getBuffer().toString())));
  -        } catch (IOException e) {
  +        } catch (Exception e) {
               return null;
           }
       }
  
  
  
  1.40      +8 -4      xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java
  
  Index: EchoHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- EchoHandler.java	18 Sep 2002 16:10:29 -0000	1.39
  +++ EchoHandler.java	10 Oct 2002 19:56:44 -0000	1.40
  @@ -126,9 +126,13 @@
               "</definitions>";
   
       public void generateWSDL(MessageContext msgContext) throws AxisFault {
  -        String url = msgContext.getStrProp("hostname"); // !!! Get this for real
  -        String wsdlString = wsdlStart + url + wsdlEnd;
  -        Document doc = XMLUtils.newDocument(wsdlString);
  -        msgContext.setProperty("WSDL", doc);
  +        try {
  +            String url = msgContext.getStrProp("hostname"); // !!! Get this for real
  +            String wsdlString = wsdlStart + url + wsdlEnd;
  +            Document doc = XMLUtils.newDocument(wsdlString);
  +            msgContext.setProperty("WSDL", doc);
  +        } catch (Exception e) {
  +            throw AxisFault.makeFault(e);
  +        }
       }
   };
  
  
  
  1.25      +10 -2     xml-axis/java/src/org/apache/axis/message/SOAPBodyElement.java
  
  Index: SOAPBodyElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBodyElement.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SOAPBodyElement.java	18 Sep 2002 16:10:28 -0000	1.24
  +++ SOAPBodyElement.java	10 Oct 2002 19:56:44 -0000	1.25
  @@ -60,6 +60,7 @@
   import org.apache.axis.utils.JavaUtils;
   import org.w3c.dom.Element;
   import org.xml.sax.Attributes;
  +import org.apache.axis.InternalException;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  @@ -69,7 +70,6 @@
   import javax.xml.soap.Name;
   import java.io.InputStream;
   
  -
   /** 
    * A Body element.
    */
  @@ -104,7 +104,15 @@
   
       public SOAPBodyElement(InputStream input) 
       {
  -        super( XMLUtils.newDocument(input).getDocumentElement() );
  +        super( getDocumentElement(input) );
  +    }
  +
  +    private static Element getDocumentElement(InputStream input) {
  +        try {
  +            return XMLUtils.newDocument(input).getDocumentElement();
  +        } catch (Exception e) {
  +            throw new InternalException(e);
  +        }
       }
   
       public void setParentElement(SOAPElement parent) throws SOAPException {
  
  
  
  1.4       +8 -2      xml-axis/java/src/org/apache/axis/message/Text.java
  
  Index: Text.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/Text.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Text.java	10 Jul 2002 15:39:14 -0000	1.3
  +++ Text.java	10 Oct 2002 19:56:44 -0000	1.4
  @@ -55,6 +55,8 @@
   
   package org.apache.axis.message;
   
  +import org.apache.axis.InternalException;
  +
   /**
    * A representation of a node whose value is text. A <CODE>
    *   Text</CODE> object may represent text that is content or text
  @@ -65,8 +67,12 @@
   public class Text extends MessageElement implements javax.xml.soap.Text {
   
       public Text(String s) {
  -        org.w3c.dom.Document doc = org.apache.axis.utils.XMLUtils.newDocument();
  -        textRep = doc.createTextNode(s);
  +        try {
  +            org.w3c.dom.Document doc = org.apache.axis.utils.XMLUtils.newDocument();
  +            textRep = doc.createTextNode(s);
  +        } catch (javax.xml.parsers.ParserConfigurationException e) {
  +            throw new InternalException(e);
  +        }
       }
   
       /**
  
  
  
  1.126     +2 -1      xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- Admin.java	24 Sep 2002 20:45:20 -0000	1.125
  +++ Admin.java	10 Oct 2002 19:56:45 -0000	1.126
  @@ -268,7 +268,8 @@
           try {
               writer.close();
               return XMLUtils.newDocument(new InputSource(new StringReader(writer.getBuffer().toString())));
  -        } catch (IOException e) {
  +        } catch (Exception e) {
  +            log.error("exception00", e);
               return null;
           }
       }
  
  
  
  1.71      +83 -47    xml-axis/java/src/org/apache/axis/utils/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/XMLUtils.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- XMLUtils.java	18 Sep 2002 16:10:41 -0000	1.70
  +++ XMLUtils.java	10 Oct 2002 19:56:45 -0000	1.71
  @@ -56,6 +56,7 @@
   package org.apache.axis.utils ;
   
   import org.apache.axis.Constants;
  +import org.apache.axis.InternalException;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  @@ -87,8 +88,11 @@
   import java.io.OutputStream;
   import java.io.OutputStreamWriter;
   import java.io.Writer;
  +import java.io.IOException;
   import java.io.ByteArrayOutputStream;
   import java.io.ByteArrayInputStream;
  +import java.io.UnsupportedEncodingException;
  +import java.net.ProtocolException;
   import java.net.HttpURLConnection;
   import java.net.MalformedURLException;
   import java.net.URL;
  @@ -283,37 +287,60 @@
               tryReset= false;
           }
       }
  -
  -    public static Document newDocument() {
  -        try {
  -            synchronized (dbf) {
  -                return dbf.newDocumentBuilder().newDocument();
  -            }
  -        } catch (Exception e) {
  -            return null;
  +    /**
  +     * Get an empty new Document
  +     * @return Document
  +     * @throws ParserConfigurationException if construction problems occur
  +     */
  +    public static Document newDocument() 
  +         throws ParserConfigurationException
  +    {
  +        synchronized (dbf) {
  +            return dbf.newDocumentBuilder().newDocument();
           }
       }
   
  -    public static Document newDocument(InputSource inp) {
  -        try {
  -            DocumentBuilder db;
  -            synchronized (dbf) {
  -                db = dbf.newDocumentBuilder();
  -            }
  -            db.setErrorHandler( new ParserErrorHandler() );
  -            return( db.parse( inp ) );
  -        }
  -        catch( Exception e ) {
  -            log.error(Messages.getMessage("exception00"), e);
  +    /**
  +     * Get a new Document read from the input source
  +     * @return Document
  +     * @throws ParserConfigurationException if construction problems occur
  +     * @throws SAXException if the document has xml sax problems
  +     * @throws IOException if i/o exceptions occur
  +     */
  +    public static Document newDocument(InputSource inp)
  +        throws ParserConfigurationException, SAXException, IOException
  +    {
  +        DocumentBuilder db;
  +        synchronized (dbf) {
  +            db = dbf.newDocumentBuilder();
           }
  -        return( null );
  +        db.setErrorHandler( new ParserErrorHandler() );
  +        return( db.parse( inp ) );
       }
   
  -    public static Document newDocument(InputStream inp) {
  +    /**
  +     * Get a new Document read from the input stream
  +     * @return Document
  +     * @throws ParserConfigurationException if construction problems occur
  +     * @throws SAXException if the document has xml sax problems
  +     * @throws IOException if i/o exceptions occur
  +     */
  +    public static Document newDocument(InputStream inp) 
  +        throws ParserConfigurationException, SAXException, IOException 
  +    {
           return XMLUtils.newDocument(new InputSource(inp));
  -    }
  +    } 
   
  -    public static Document newDocument(String uri) {
  +    /**
  +     * Get a new Document read from the indicated uri
  +     * @return Document
  +     * @throws ParserConfigurationException if construction problems occur
  +     * @throws SAXException if the document has xml sax problems
  +     * @throws IOException if i/o exceptions occur
  +     */
  +    public static Document newDocument(String uri) 
  +        throws ParserConfigurationException, SAXException, IOException 
  +    {
           // call the authenticated version as there might be 
           // username/password info embeded in the uri.
           return XMLUtils.newDocument(uri, null, null);
  @@ -322,23 +349,26 @@
       /**
        * Create a new document from the given URI, use the username and password
        * if the URI requires authentication.
  +     * @param uri the resource to get
  +     * @param username basic auth username
  +     * @param password basic auth password
  +     * @throws ParserConfigurationException if construction problems occur
  +     * @throws SAXException if the document has xml sax problems
  +     * @throws IOException if i/o exceptions occur
        */ 
  -    public static Document newDocument(String uri, String username, String password) {
  -        try {
  -            InputSource ins = XMLUtils.getInputSourceFromURI(uri, username, password);
  -            Document doc = XMLUtils.newDocument(ins);
  -            // Close the Stream
  -            if (ins.getByteStream() != null) {
  -                ins.getByteStream().close();
  -            } else if (ins.getCharacterStream() != null) {
  -                ins.getCharacterStream().close();
  -            }
  -            return doc;
  -        } catch (Exception e) {
  -            log.error(Messages.getMessage("exception00"), e);
  -        }
  -        return null;
  -    }
  +    public static Document newDocument(String uri, String username, String password)
  +        throws ParserConfigurationException, SAXException, IOException
  +     {
  +         InputSource ins = XMLUtils.getInputSourceFromURI(uri, username, password);
  +         Document doc = XMLUtils.newDocument(ins);
  +         // Close the Stream
  +         if (ins.getByteStream() != null) {
  +             ins.getByteStream().close();
  +         } else if (ins.getCharacterStream() != null) {
  +             ins.getCharacterStream().close();
  +         }
  +         return doc;
  +     }
   
       private static String privateElementToString(Element element,
                                                    boolean omitXMLDecl)
  @@ -401,14 +431,20 @@
        * @param namespace - element namespace
        * @param name - element name
        * @param string - value of the text node
  -     * @return element - an XML Element
  +     * @return element - an XML Element, null if no element was created
        */ 
       public static Element StringToElement(String namespace, String name, String string) {
  -        Document doc = XMLUtils.newDocument();
  -        Element element = doc.createElementNS(namespace, name);
  -        Text text = doc.createTextNode(string);
  -        element.appendChild(text);
  -        return element;
  +        try {
  +            Document doc = XMLUtils.newDocument();
  +            Element element = doc.createElementNS(namespace, name);
  +            Text text = doc.createTextNode(string);
  +            element.appendChild(text);
  +            return element;
  +        } 
  +        catch (ParserConfigurationException e) {
  +            // This should not occur
  +            throw new InternalException(e);
  +        }
       }
       
       public static String getInnerXMLString(Element element) {
  @@ -614,8 +650,8 @@
       private static InputSource getInputSourceFromURI(String uri,
                                                        String username,
                                                        String password)
  -            throws Exception {
  -
  +        throws IOException, ProtocolException, UnsupportedEncodingException
  +    {
           URL wsdlurl = null;
           try {
               wsdlurl = new URL(uri);
  
  
  
  1.71      +56 -11    xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- Emitter.java	10 Oct 2002 17:22:54 -0000	1.70
  +++ Emitter.java	10 Oct 2002 19:56:45 -0000	1.71
  @@ -76,6 +76,8 @@
   import org.apache.axis.utils.JavaUtils;
   import org.w3c.dom.Document;
   
  +import org.xml.sax.SAXException;
  +
   import javax.wsdl.Binding;
   import javax.wsdl.BindingFault;
   import javax.wsdl.BindingInput;
  @@ -105,6 +107,7 @@
   import javax.wsdl.factory.WSDLFactory;
   
   import javax.xml.namespace.QName;
  +import javax.xml.parsers.ParserConfigurationException;
   
   import java.io.File;
   import java.io.FileOutputStream;
  @@ -182,8 +185,13 @@
        * @param filename2  implementation WSDL
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public void emit(String filename1, String filename2) throws IOException, WSDLException {
  +    public void emit(String filename1, String filename2) 
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           // Get interface and implementation defs
           Definition intf = getIntfWSDL();
           Definition impl = getImplWSDL();
  @@ -213,8 +221,13 @@
        * @param filename  WSDL
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public void emit(String filename) throws IOException, WSDLException {
  +    public void emit(String filename) 
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           emit(filename, MODE_ALL);
       }
   
  @@ -229,8 +242,13 @@
        * @return Document
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public Document emit(int mode) throws IOException, WSDLException {
  +    public Document emit(int mode)
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           Document doc = null;
           Definition def = null;
           switch (mode) {
  @@ -268,8 +286,13 @@
        * @return String
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public String emitToString(int mode) throws IOException, WSDLException {
  +    public String emitToString(int mode)
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           Document doc = emit(mode);
           StringWriter sw = new StringWriter();
           XMLUtils.PrettyDocumentToWriter(doc, sw);
  @@ -287,8 +310,13 @@
        * @param mode generation mode - all, interface, implementation
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public void emit(String filename, int mode) throws IOException, WSDLException {
  +    public void emit(String filename, int mode) 
  +        throws IOException, WSDLException,
  +               SAXException, ParserConfigurationException
  +    {
           Document doc = emit(mode);
   
           // Supply a reasonable file name if not supplied
  @@ -317,8 +345,13 @@
        * @return WSDL <code>Definition</code>
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public Definition getWSDL() throws IOException, WSDLException {
  +    public Definition getWSDL() 
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           // Invoke the init() method to ensure configuration is setup
           init(MODE_ALL);
   
  @@ -345,8 +378,13 @@
        * @return WSDL <code>Definition</code>
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public Definition getIntfWSDL() throws IOException, WSDLException {
  +    public Definition getIntfWSDL() 
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException 
  +    {
           // Invoke the init() method to ensure configuration is setup
           init(MODE_INTERFACE);
   
  @@ -372,8 +410,12 @@
        * @return WSDL <code>Definition</code>
        * @throws IOException
        * @throws WSDLException
  +     * @throws SAXException
  +     * @throws ParserConfigurationException
        */
  -    public Definition getImplWSDL() throws IOException, WSDLException {
  +    public Definition getImplWSDL()
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException {
           // Invoke the init() method to ensure configuration is setup
           init(MODE_IMPLEMENTATION);
   
  @@ -523,7 +565,8 @@
        * @return WSDL Definition
        */
       private Definition createDefinition()
  -        throws WSDLException {
  +        throws WSDLException, SAXException, IOException, 
  +               ParserConfigurationException {
           Definition def;
           if (inputWSDL == null) {
               def = WSDLFactory.newInstance().newDefinition();
  @@ -545,7 +588,8 @@
        * @return Types object
        */
       private Types createTypes(Definition def)
  -        throws IOException, WSDLException {
  +        throws IOException, WSDLException, SAXException,
  +               ParserConfigurationException {
           types = new Types(def, tm, defaultTM, namespaces,
                             intfNS, stopClasses);
           if (inputWSDL != null) {
  @@ -1159,7 +1203,8 @@
                       msg.addPart(part);
                   }
               }
  -        } else if (use == Use.ENCODED) {
  +        } else if (use == Use.ENCODED || 
  +                   style == Style.RPC) {
               // Add the type representing the param
               // For convenience, add an element for the param
               // Write <part name=param_name type=param_type>
  
  
  
  1.64      +11 -2     xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- Types.java	26 Sep 2002 21:52:13 -0000	1.63
  +++ Types.java	10 Oct 2002 19:56:45 -0000	1.64
  @@ -58,6 +58,7 @@
   
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
  +import org.apache.axis.InternalException;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.SerializerFactory;
   import org.apache.axis.encoding.SimpleType;
  @@ -70,6 +71,7 @@
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
   import org.apache.axis.wsdl.symbolTable.Type;
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
  +import javax.xml.parsers.ParserConfigurationException;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  @@ -80,6 +82,7 @@
   import org.w3c.dom.NamedNodeMap;
   import org.w3c.dom.NodeList;
   import org.w3c.dom.Node;
  +import org.xml.sax.SAXException;
   
   import javax.wsdl.Definition;
   import javax.wsdl.WSDLException;
  @@ -158,7 +161,8 @@
        * @param inputWSDL file or URL
        */
       public void loadInputTypes(String inputWSDL)
  -        throws IOException, WSDLException
  +        throws IOException, WSDLException,
  +               SAXException, ParserConfigurationException
       {
   
           // Read the input wsdl file into a Document
  @@ -1021,7 +1025,12 @@
       Document docHolder;
   
       private void createDocumentFragment () {
  -        this.docHolder = XMLUtils.newDocument();
  +        try {
  +            this.docHolder = XMLUtils.newDocument();
  +        }  catch (ParserConfigurationException e) {
  +            // This should not occur
  +            throw new InternalException(e);
  +        }
       }
   
       /**
  
  
  
  1.13      +6 -1      xml-axis/java/src/org/apache/axis/wsdl/gen/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/gen/Parser.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Parser.java	2 Oct 2002 17:24:03 -0000	1.12
  +++ Parser.java	10 Oct 2002 19:56:45 -0000	1.13
  @@ -66,6 +66,9 @@
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
   import org.w3c.dom.Document;
   
  +import javax.xml.parsers.ParserConfigurationException;
  +import org.xml.sax.SAXException;
  +
   import javax.wsdl.Binding;
   import javax.wsdl.Definition;
   import javax.wsdl.WSDLException;
  @@ -257,7 +260,9 @@
        * @param context context This is directory context for the Document.  If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work).  If context is null, then the context becomes the current directory.
        * @param doc doc This is the XML Document containing the WSDL.
        */
  -    public void run(String context, Document doc) throws IOException, WSDLException {
  +    public void run(String context, Document doc) 
  +        throws IOException, SAXException, WSDLException, 
  +               ParserConfigurationException {
           if (getFactory() == null) {
               setFactory(new NoopFactory());
           }
  
  
  
  1.47      +31 -14    xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- SymbolTable.java	9 Oct 2002 20:51:28 -0000	1.46
  +++ SymbolTable.java	10 Oct 2002 19:56:45 -0000	1.47
  @@ -97,6 +97,7 @@
   import javax.xml.namespace.QName;
   
   import javax.wsdl.xml.WSDLReader;
  +import javax.xml.parsers.ParserConfigurationException;
   
   import javax.wsdl.extensions.http.HTTPBinding;
   import javax.wsdl.extensions.soap.SOAPBinding;
  @@ -120,6 +121,7 @@
   import org.w3c.dom.NamedNodeMap;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  +import org.xml.sax.SAXException;
   
   /**
   * This class represents a table of all of the top-level symbols from a set of WSDL Definitions and
  @@ -341,18 +343,19 @@
        * @param uri wsdlURI the location of the WSDL file.
        */
   
  -    public void populate(String uri) throws IOException, WSDLException {
  +    public void populate(String uri)
  +        throws IOException, WSDLException,
  +               SAXException, ParserConfigurationException {
           populate(uri, null, null);
       } // populate
   
  -    public void populate(String uri, String username, String password) throws IOException, WSDLException {
  +    public void populate(String uri, String username, String password)
  +        throws IOException, WSDLException, 
  +               SAXException, ParserConfigurationException  {
           if (verbose)
               System.out.println(Messages.getMessage("parsing00", uri));
   
           Document doc = XMLUtils.newDocument(uri, username, password);
  -        if (doc == null) {
  -            throw new IOException(Messages.getMessage("cantGetDoc00", uri));
  -        }
           this.wsdlURI = uri;
           try {
               File f = new File(uri);
  @@ -369,7 +372,9 @@
        * @param context context This is directory context for the Document.  If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work).  If context is null, then the context becomes the current directory.
        * @param doc doc This is the XML Document containing the WSDL.
        */
  -    public void populate(String context, Document doc) throws IOException, WSDLException {
  +    public void populate(String context, Document doc)
  +        throws IOException, SAXException, WSDLException, 
  +               ParserConfigurationException {
           WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
           reader.setFeature("javax.wsdl.verbose", verbose);
           this.def = reader.readWSDL(context, doc);
  @@ -384,7 +389,8 @@
        * appropriately for each entry.
        */
       private void add(String context, Definition def, Document doc)
  -            throws IOException {
  +            throws IOException, SAXException, WSDLException, 
  +                   ParserConfigurationException {
           URL contextURL = context == null ? null : getURL(null, context);
           populate(contextURL, def, doc, null);
           checkForUndefined();
  @@ -509,7 +515,9 @@
        */
       private URLHashSet importedFiles = new URLHashSet();
       private void populate(URL context, Definition def, Document doc,
  -            String filename) throws IOException {
  +            String filename) 
  +        throws IOException, ParserConfigurationException, 
  +               SAXException, WSDLException {
           if (doc != null) {
               populateTypes(context, doc);
   
  @@ -598,7 +606,9 @@
       /**
        * Recursively find all xsd:import'ed objects and call populate for each one.
        */
  -    private void lookForImports(URL context, Node node) throws IOException {
  +    private void lookForImports(URL context, Node node) 
  +        throws IOException, ParserConfigurationException,
  +               SAXException, WSDLException {
           NodeList children = node.getChildNodes();
           for (int i = 0; i < children.getLength(); i++) {
               Node child = children.item(i);
  @@ -629,7 +639,9 @@
       /**
        * Populate the symbol table with all of the Types from the Document.
        */
  -    private void populateTypes(URL context, Document doc) throws IOException {
  +    private void populateTypes(URL context, Document doc)
  +        throws IOException, SAXException, WSDLException, 
  +               ParserConfigurationException {
           addTypes(context, doc, ABOVE_SCHEMA_LEVEL);
       } // populateTypes
   
  @@ -637,14 +649,19 @@
        * Utility method which walks the Document and creates Type objects for
        * each complexType, simpleType, or element referenced or defined.
        *
  -     * What goes into the symbol table?  In general, only the top-level types (ie., those just below
  -     * the schema tag).  But base types and references can appear below the top level.  So anything
  -     * at the top level is added to the symbol table, plus non-Element types (ie, base and refd)
  +     * What goes into the symbol table?  In general, only the top-level types 
  +     * (ie., those just below
  +     * the schema tag).  But base types and references can 
  +     * appear below the top level.  So anything
  +     * at the top level is added to the symbol table, 
  +     * plus non-Element types (ie, base and refd)
        * that appear deep within other types.
        */
       private static final int ABOVE_SCHEMA_LEVEL = -1;
       private static final int SCHEMA_LEVEL = 0;
  -    private void addTypes(URL context, Node node, int level) throws IOException {
  +    private void addTypes(URL context, Node node, int level) 
  +        throws IOException, ParserConfigurationException, 
  +               WSDLException, SAXException {
           if (node == null) {
               return;
           }
  
  
  
  1.50      +8 -2      xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- Emitter.java	25 Sep 2002 20:16:23 -0000	1.49
  +++ Emitter.java	10 Oct 2002 19:56:45 -0000	1.50
  @@ -81,6 +81,8 @@
   import org.apache.axis.wsdl.symbolTable.BaseTypeMapping;
   
   import org.w3c.dom.Document;
  +import org.xml.sax.SAXException;
  +import javax.xml.parsers.ParserConfigurationException;
   
   /**
    * This class produces java files for stubs, skeletons, and types from a
  @@ -388,7 +390,9 @@
        * If context is null, then the context becomes the current directory.
        * @param doc doc This is the XML Document containing the WSDL.
        */
  -    public void run(String context, Document doc) throws IOException, WSDLException {
  +    public void run(String context, Document doc) throws 
  +        IOException, SAXException, WSDLException, 
  +        ParserConfigurationException {
           setup();
           super.run(context, doc);
       } // run
  @@ -509,7 +513,9 @@
        * @param doc doc This is the XML Document containing the WSDL.
        * @deprecated Call run(context, doc) instead.
        */
  -    public void emit(String context, Document doc) throws IOException, WSDLException {
  +    public void emit(String context, Document doc)
  +        throws IOException, SAXException, WSDLException, 
  +               ParserConfigurationException {
           run(context, doc);
       } // emit
   
  
  
  
  1.14      +12 -12    xml-axis/java/test/utils/TestXMLUtils.java
  
  Index: TestXMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/utils/TestXMLUtils.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TestXMLUtils.java	18 Jun 2002 18:01:25 -0000	1.13
  +++ TestXMLUtils.java	10 Oct 2002 19:56:45 -0000	1.14
  @@ -32,13 +32,13 @@
       public void setup() {
       }
   
  -    public void testNewDocumentNoArgConstructor()
  +    public void testNewDocumentNoArgConstructor() throws Exception
       {
           Document doc = XMLUtils.newDocument();
           assertNotNull("Did not get a new Document", doc);
       }
   
  -    public void testNewDocumentInputSource()
  +    public void testNewDocumentInputSource() throws Exception
       {
           Reader reader = (Reader)this.getTestXml("reader");
           InputSource inputsrc = new InputSource(reader);
  @@ -46,7 +46,7 @@
           assertNotNull("Did not get a new Document", doc);
       }
   
  -    public void testNewDocumentInputStream()
  +    public void testNewDocumentInputStream() throws Exception
       {
           InputStream iostream = (InputStream)this.getTestXml("inputstream");
           InputSource inputsrc = new InputSource(iostream);
  @@ -67,7 +67,7 @@
       }
       */
   
  -    public void testDocumentToString()
  +    public void testDocumentToString() throws Exception
       {
           Reader reader = (Reader)this.getTestXml("reader");
           InputSource inputsrc = new InputSource(reader);
  @@ -84,7 +84,7 @@
       * type but writes its output to a writer.  So half the reason for
       * creating and using it here is as a reference point.
       */
  -    public void testElementToWriter() throws IOException
  +    public void testElementToWriter() throws Exception
       {
           /* Get the Document and one of its elements. */
           Reader xmlReader = (Reader)this.getTestXml("reader");
  @@ -126,7 +126,7 @@
       * For explanation of the methodology used to test this method, see notes in
       * previous test method.
       */
  -    public void testDocumentToStream() throws IOException
  +    public void testDocumentToStream() throws Exception
       {
           Reader reader = (Reader)this.getTestXml("reader");
           InputSource inputsrc = new InputSource(reader);
  @@ -144,7 +144,7 @@
           assertEquals("Did not get the expected result", expected, result);
       }
   
  -    public void testElementToString()
  +    public void testElementToString() throws Exception
       {
           Reader reader = (Reader)this.getTestXml("reader");
           InputSource inputsrc = new InputSource(reader);
  @@ -159,7 +159,7 @@
           assertEquals("Did not get the expected result", expected, result);
       }
   
  -    public void testGetInnerXMLString()
  +    public void testGetInnerXMLString() throws Exception
       {
           Reader reader = (Reader)this.getTestXml("reader");
           InputSource inputsrc = new InputSource(reader);
  @@ -172,7 +172,7 @@
           assertEquals(expected, result);
       }
   
  -    public void testGetPrefix()
  +    public void testGetPrefix() throws Exception
       {
           Document doc = XMLUtils.newDocument();
   
  @@ -192,7 +192,7 @@
           assertEquals("Did not get the expected result", expected, result);
       }
   
  -    public void testGetNamespace()
  +    public void testGetNamespace() throws Exception
       {
           String testDoc = "<svg xmlns:svg=\"http://www.w3.org/2000/svg\"/>";
           InputSource inputsrc = new InputSource(new StringReader(testDoc));
  @@ -259,7 +259,7 @@
           else return null;
       }
   
  -    public void testDOM2Writer()
  +    public void testDOM2Writer() throws Exception
       {
           StringBuffer sb = new StringBuffer();
           sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
  @@ -282,7 +282,7 @@
           assertTrue(output.indexOf("http://www.w3.org/XML/1998/namespace")==-1);
       }
   
  -    public static void main(String[] args)
  +    public static void main(String[] args) throws Exception
       {
           TestXMLUtils test = new TestXMLUtils("TestXMLUtils");
           test.testDOM2Writer();
  
  
  
  1.2       +2 -2      xml-axis/java/test/wsdl/import3/MultiImpIncl/CompoGlobals.xsd
  
  Index: CompoGlobals.xsd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/import3/MultiImpIncl/CompoGlobals.xsd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CompoGlobals.xsd	26 Jul 2002 15:48:27 -0000	1.1
  +++ CompoGlobals.xsd	10 Oct 2002 19:56:45 -0000	1.2
  @@ -7,7 +7,7 @@
   
     <import
       namespace="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
  -    schemaLocation="../AxsGlobals.xsd"/>
  +    schemaLocation="AxsGlobals.xsd"/>
   
    
     <simpleType name="DocActions">
  @@ -97,4 +97,4 @@
         </extension>
       </complexContent>
     </complexType>
  -</schema>
  \ No newline at end of file
  +</schema>
  
  
  
  1.6       +2 -2      xml-axis/java/test/wsdl/inheritance/InheritanceTestCase.java
  
  Index: InheritanceTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/inheritance/InheritanceTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- InheritanceTestCase.java	9 Oct 2002 19:06:34 -0000	1.5
  +++ InheritanceTestCase.java	10 Oct 2002 19:56:45 -0000	1.6
  @@ -154,8 +154,8 @@
               //reader.setFeature("javax.wsdl.verbose", true);
               def = reader.readWSDL(path, doc);
               assertNotNull("unable to generate WSDL definition from document: " + path, def);
  -        } catch (WSDLException e) {
  -            throw new junit.framework.AssertionFailedError("WSDL Exception caught: " + e);
  +        } catch (Exception e) {
  +            throw new junit.framework.AssertionFailedError("Exception caught: " + e);
           }
           
           // Now check parts of the definition
  
  
  
  1.4       +1 -1      xml-axis/java/test/wsdl/sequence/SequenceService.java
  
  Index: SequenceService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/sequence/SequenceService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SequenceService.java	24 Sep 2002 20:45:20 -0000	1.3
  +++ SequenceService.java	10 Oct 2002 19:56:46 -0000	1.4
  @@ -83,7 +83,7 @@
        * @return a SOAP response in a DOM Element, either boolean true or false,
        *         indicating the success/failure of the test.
        */
  -    public Element [] testSequence(Element [] elems) {
  +    public Element [] testSequence(Element [] elems) throws Exception {
           Element zero = null;
           for (int i = 0; i < elems.length; i++) {
               zero = findTheZero(elems[i]);