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 rk...@apache.org on 2001/12/04 01:59:26 UTC
cvs commit: xml-axis/java/src/org/apache/axis/wsdl Emitter.java JavaDeployWriter.java JavaUndeployWriter.java
rkumar 01/12/03 16:59:26
Modified: java/src/org/apache/axis/wsdl Emitter.java
JavaDeployWriter.java JavaUndeployWriter.java
Log:
In the WSDL emitter, instead of trapping Exceptions and printing traces
to the console, surface the exceptions to the applications
Also, throw specifc Execptions - IOException and WSDLException
Revision Changes Path
1.108 +27 -40 xml-axis/java/src/org/apache/axis/wsdl/Emitter.java
Index: Emitter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Emitter.java,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- Emitter.java 2001/11/28 15:37:42 1.107
+++ Emitter.java 2001/12/04 00:59:26 1.108
@@ -63,6 +63,7 @@
import javax.wsdl.Message;
import javax.wsdl.PortType;
import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import java.io.IOException;
@@ -132,57 +133,43 @@
/**
* Call this method if you have a uri for the WSDL document
*/
- public void emit(String uri) throws IOException {
+ public void emit(String uri) throws IOException, WSDLException {
if (bVerbose)
System.out.println(JavaUtils.getMessage("parsing00", uri));
- try {
- emit(XMLUtils.newDocument(uri));
- }
- catch (Throwable t) {
- t.printStackTrace();
- System.out.println(
- JavaUtils.getMessage("parseError00", t.getMessage()));
- }
+ emit(XMLUtils.newDocument(uri));
} // emit
/**
* Call this method if your WSDL document has already been parsed as an XML DOM document.
*/
- public void emit(Document doc) throws IOException {
- try {
- WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
- reader.setVerbose(bVerbose);
- def = reader.readWSDL(null, doc);
- this.doc = doc;
- namespaces = new Namespaces(outputDir);
-
- // First, read the namespace mapping file - NStoPkg.properties - if it
- // exists, and load the namespaceMap HashMap with its data.
- getNStoPkgFromPropsFile(namespaces);
-
- if (delaySetMap != null) {
- namespaces.putAll(delaySetMap);
- }
-
- symbolTable = new SymbolTable(namespaces, bGenerateImports);
- symbolTable.add(def, doc);
- writerFactory.writerPass(def, symbolTable);
- emit(def, doc);
-
- // Output extra stuff (deployment files and faults)
- // outside of the recursive emit method.
- Writer writer = writerFactory.getWriter(def, symbolTable);
- writer.write();
- }
- catch (Throwable t) {
- t.printStackTrace();
- System.out.println(
- JavaUtils.getMessage("parseError00", t.getMessage()));
+ public void emit(Document doc) throws IOException, WSDLException {
+ WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
+ reader.setVerbose(bVerbose);
+ def = reader.readWSDL(null, doc);
+ this.doc = doc;
+ namespaces = new Namespaces(outputDir);
+
+ // First, read the namespace mapping file - NStoPkg.properties - if it
+ // exists, and load the namespaceMap HashMap with its data.
+ getNStoPkgFromPropsFile(namespaces);
+
+ if (delaySetMap != null) {
+ namespaces.putAll(delaySetMap);
}
+
+ symbolTable = new SymbolTable(namespaces, bGenerateImports);
+ symbolTable.add(def, doc);
+ writerFactory.writerPass(def, symbolTable);
+ emit(def, doc);
+
+ // Output extra stuff (deployment files and faults)
+ // outside of the recursive emit method.
+ Writer writer = writerFactory.getWriter(def, symbolTable);
+ writer.write();
} // emit
- private void emit(Definition def, Document doc) throws IOException {
+ private void emit(Definition def, Document doc) throws IOException, WSDLException {
if (bVerbose) {
System.out.println(JavaUtils.getMessage("types00"));
dumpTypes();
1.9 +4 -10 xml-axis/java/src/org/apache/axis/wsdl/JavaDeployWriter.java
Index: JavaDeployWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/JavaDeployWriter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JavaDeployWriter.java 2001/12/03 21:04:30 1.8
+++ JavaDeployWriter.java 2001/12/04 00:59:26 1.9
@@ -101,16 +101,10 @@
* Write the body of the deploy.xml file.
*/
protected void writeFileBody() throws IOException {
- try {
- writeDeployServices();
- writeDeployTypes();
- pw.println("</deployment>");
- pw.close();
- }
- catch (IOException e) {
- System.err.println(JavaUtils.getMessage("genDeployFail00"));
- e.printStackTrace();
- }
+ writeDeployServices();
+ writeDeployTypes();
+ pw.println("</deployment>");
+ pw.close();
} // writeFileBody
/**
1.5 +3 -9 xml-axis/java/src/org/apache/axis/wsdl/JavaUndeployWriter.java
Index: JavaUndeployWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/JavaUndeployWriter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JavaUndeployWriter.java 2001/11/27 18:32:09 1.4
+++ JavaUndeployWriter.java 2001/12/04 00:59:26 1.5
@@ -98,15 +98,9 @@
* Write the body of the deploy.xml file.
*/
protected void writeFileBody() throws IOException {
- try {
- writeDeployServices();
- pw.println("</deployment>");
- pw.close();
- }
- catch (IOException e) {
- System.err.println(JavaUtils.getMessage("genUndeployFail00"));
- e.printStackTrace();
- }
+ writeDeployServices();
+ pw.println("</deployment>");
+ pw.close();
} // writeFileBody
/**