butek 02/02/05 11:37:48
Modified: java/src/javax/xml/rpc Call.java ServiceFactory.java
java/src/org/apache/axis/client Call.java
ServiceFactory.java
java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
Log:
JAXRPCException now extends RuntimeException, so it doesn't have to be
explicitly caught or in the throws clause. This particularly cleans up stub code.
NOTE: I didn't exhaustively go through our runtime removing
"throws JAXRPCException". That's still legal code. I simply removed it from
JAX-RPC classes since they've been removed in the spec.
Revision Changes Path
1.7 +5 -5 xml-axis/java/src/javax/xml/rpc/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/javax/xml/rpc/Call.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Call.java 4 Jan 2002 22:30:03 -0000 1.6
+++ Call.java 5 Feb 2002 19:37:48 -0000 1.7
@@ -103,7 +103,7 @@
* addParameter will throw JAXRPCException.
*/
public void addParameter(String paramName, QName paramType,
- ParameterMode parameterMode) throws JAXRPCException;
+ ParameterMode parameterMode);
/**
* Given a parameter name, return the QName of its type. If the parameter
doesn't exist, this
@@ -120,7 +120,7 @@
* @exception JAXRPCException - if isParameterAndReturnSpecRequired returns
false, then
* setReturnType will throw JAXRPCException.
*/
- public void setReturnType(QName xmlType) throws JAXRPCException;
+ public void setReturnType(QName xmlType);
/**
* Get the QName of the return type.
@@ -132,7 +132,7 @@
* @exception JAXRPCException - if isParameterAndReturnSpecRequired returns
false, then
* removeAllParameters will throw JAXRPCException.
*/
- public void removeAllParameters() throws JAXRPCException;
+ public void removeAllParameters();
/**
* Gets the name of the operation to be invoked using this Call instance.
@@ -259,7 +259,7 @@
* a non-void return type has been incorrectly specified for the one-way call)
or if there is any error during
* the invocation of the one-way remote call
*/
- public void invokeOneWay(Object[] params) throws JAXRPCException;
+ public void invokeOneWay(Object[] params);
/**
* This method returns a java.util.Map of {name, value} for the PARAM_MODE_OUT
and
@@ -270,7 +270,7 @@
* @throws javax.xml.rpc.JAXRPCException - if this method is invoked on a
one-way operation or
* if it is invoked before any invoke method has been called.
*/
- public Map getOutputParams() throws JAXRPCException;
+ public Map getOutputParams();
}
1.2 +9 -9 xml-axis/java/src/javax/xml/rpc/ServiceFactory.java
Index: ServiceFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/javax/xml/rpc/ServiceFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceFactory.java 28 Jan 2002 15:30:22 -0000 1.1
+++ ServiceFactory.java 5 Feb 2002 19:37:48 -0000 1.2
@@ -78,9 +78,9 @@
* <p> The implementation class to be used can be overridden by
* setting the javax.xml.rpc.ServiceFactory system property.
* @return ServiceFactory.
- * @throws JAXRPCException
+ * @throws ServiceException
*/
- public static ServiceFactory newInstance() throws JAXRPCException {
+ public static ServiceFactory newInstance() throws ServiceException {
String factoryImplName =
System.getProperty("javax.xml.rpc.ServiceFactory",
"com.sun.xml.rpc.client.ServiceFactoryImpl");
@@ -89,13 +89,13 @@
return (ServiceFactory) clazz.newInstance();
}
catch (ClassNotFoundException e) {
- throw new JAXRPCException(e);
+ throw new ServiceException(e);
}
catch (IllegalAccessException e) {
- throw new JAXRPCException(e);
+ throw new ServiceException(e);
}
catch (InstantiationException e) {
- throw new JAXRPCException(e);
+ throw new ServiceException(e);
}
}
@@ -105,16 +105,16 @@
for the service
* @param serviceName QName for the service.
* @return Service.
- * @throws JAXRPCException If any error in creation of the specified service
+ * @throws ServiceException If any error in creation of the specified service
*/
public abstract Service createService(URL wsdlDocumentLocation, QName
serviceName)
- throws JAXRPCException;
+ throws ServiceException;
/**
* Create a Service instance.
* @param serviceName QName for the service
* @return Service.
- * @throws JAXRPCException If any error in creation of the specified service
+ * @throws ServiceException If any error in creation of the specified service
*/
- public abstract Service createService(QName serviceName) throws JAXRPCException;
+ public abstract Service createService(QName serviceName) throws
ServiceException;
}
1.67 +10 -13 xml-axis/java/src/org/apache/axis/client/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- Call.java 1 Feb 2002 22:08:25 -0000 1.66
+++ Call.java 5 Feb 2002 19:37:48 -0000 1.67
@@ -202,7 +202,7 @@
* @param url the target endpoint URL
* @exception MalformedURLException
*/
- public Call(String url) throws MalformedURLException, JAXRPCException {
+ public Call(String url) throws MalformedURLException {
this(new Service());
setTargetEndpointAddress(new URL(url));
}
@@ -212,7 +212,7 @@
*
* @param url the target endpoint URL
*/
- public Call(URL url) throws JAXRPCException {
+ public Call(URL url) {
this(new Service());
setTargetEndpointAddress(url);
}
@@ -257,7 +257,7 @@
* or PARAM_MODE_INOUT
*/
public void addParameter(String paramName, QName paramType,
- ParameterMode parameterMode) throws JAXRPCException {
+ ParameterMode parameterMode) {
if (parmAndRetReq) {
if ( paramNames == null ) {
@@ -301,7 +301,7 @@
*
* @param type QName of the return value type.
*/
- public void setReturnType(QName type) throws JAXRPCException {
+ public void setReturnType(QName type) {
if (parmAndRetReq) {
returnType = type ;
}
@@ -327,7 +327,7 @@
* @exception JAXRPCException - if isParameterAndReturnSpecRequired returns
false, then
* removeAllParameters will throw JAXRPCException.
*/
- public void removeAllParameters() throws JAXRPCException {
+ public void removeAllParameters() {
if (parmAndRetReq) {
paramNames = null ;
paramTypes = null ;
@@ -366,8 +366,7 @@
operationName = new QName(opName);
}
- public void setOperation(QName portName, String opName)
- throws JAXRPCException{
+ public void setOperation(QName portName, String opName) {
if ( service == null )
throw new JAXRPCException( JavaUtils.getMessage("noService04") );
@@ -782,13 +781,12 @@
* @param params Array of parameters to invoke the Web Service with
* @throws JAXRPCException is there's an error
*/
- public void invokeOneWay(Object[] params)
- throws javax.xml.rpc.JAXRPCException {
+ public void invokeOneWay(Object[] params) {
try {
invoke( getParamList(params) );
}
catch( Exception exp ) {
- throw new javax.xml.rpc.JAXRPCException( exp.toString() );
+ throw new JAXRPCException( exp.toString() );
}
}
@@ -900,8 +898,7 @@
* @param params Array of parameters to pass into the operation/method
* @return Object[] Array of parameters to pass to invoke()
*/
- private Object[] getParamList(Object[] params)
- throws javax.xml.rpc.JAXRPCException {
+ private Object[] getParamList(Object[] params) {
int numParams = 0 ;
int i ;
@@ -919,7 +916,7 @@
}
if ( numParams != params.length )
- throw new javax.xml.rpc.JAXRPCException(
+ throw new JAXRPCException(
JavaUtils.getMessage("parmMismatch00",
"" + params.length, "" + numParams) );
1.4 +0 -2 xml-axis/java/src/org/apache/axis/client/ServiceFactory.java
Index: ServiceFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServiceFactory.java 30 Jan 2002 16:19:11 -0000 1.3
+++ ServiceFactory.java 5 Feb 2002 19:37:48 -0000 1.4
@@ -7,7 +7,6 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import javax.xml.rpc.JAXRPCException;
import java.util.Map;
/**
@@ -40,7 +39,6 @@
* null to use the default configuration pattern.
*/
static public Service getService(Map environment)
- throws JAXRPCException
{
Service service = null;
InitialContext context = null;
1.26 +7 -25
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
Index: JavaStubWriter.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- JavaStubWriter.java 1 Feb 2002 18:04:08 -0000 1.25
+++ JavaStubWriter.java 5 Feb 2002 19:37:48 -0000 1.26
@@ -435,7 +435,6 @@
pw.println(" throw new org.apache.axis.NoEndPointException();");
pw.println(" }");
pw.println(" javax.xml.rpc.Call call = getCall();");
- pw.println(" try {");
// DUG: need to set the isRPC flag in the Call object
@@ -448,13 +447,13 @@
qn.getNamespaceURI() + "\", \"" +
qn.getLocalPart() + "\")";
if (p.mode == Parameter.IN) {
- pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_IN);");
+ pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_IN);");
}
else if (p.mode == Parameter.INOUT) {
- pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_INOUT);");
+ pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_INOUT);");
}
else { // p.mode == Parameter.OUT
- pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_OUT);");
+ pw.println(" call.addParameter(\"" + p.name + "\", " +
typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_OUT);");
}
}
// set output type
@@ -463,16 +462,11 @@
String outputType = "new javax.xml.rpc.namespace.QName(\"" +
qn.getNamespaceURI() + "\", \"" +
qn.getLocalPart() + "\")";
- pw.println(" call.setReturnType(" + outputType + ");");
+ pw.println(" call.setReturnType(" + outputType + ");");
}
else {
- pw.println(" call.setReturnType(null);");
+ pw.println(" call.setReturnType(null);");
}
- pw.println(" }");
- pw.println(" catch (javax.xml.rpc.JAXRPCException jre) {");
- pw.println(" throw new java.rmi.RemoteException(\"" +
- JavaUtils.getMessage("badCall00") + "\");");
- pw.println(" }");
// SoapAction
if (soapAction != null) {
@@ -541,13 +535,7 @@
}
String javifiedName = Utils.xmlNameToJava(p.name);
pw.println(" java.util.Map output;");
- pw.println(" try {");
- pw.println(" output = call.getOutputParams();");
- pw.println(" }");
- pw.println(" catch (javax.xml.rpc.JAXRPCException
jre) {");
- pw.println(" throw new java.rmi.RemoteException(\"" +
- JavaUtils.getMessage("badCall02") + "\");");
- pw.println(" }");
+ pw.println(" output = call.getOutputParams();");
// If expecting an array, need to call convert(..) because
// the runtime stores arrays in a different form (ArrayList).
// NOTE A:
@@ -592,13 +580,7 @@
// resp or call.getOutputParms - and put them in the appropriate
place,
// either in a holder or as the return value.
pw.println(" java.util.Map output;");
- pw.println(" try {");
- pw.println(" output = call.getOutputParams();");
- pw.println(" }");
- pw.println(" catch (javax.xml.rpc.JAXRPCException jre)
{");
- pw.println(" throw new java.rmi.RemoteException(\"" +
- JavaUtils.getMessage("badCall02") + "\");");
- pw.println(" }");
+ pw.println(" output = call.getOutputParams();");
boolean firstInoutIsResp = (parms.outputs == 0);
for (int i = 0; i < parms.list.size (); ++i) {
Parameter p = (Parameter) parms.list.get (i);