butek 02/01/04 14:30:04
Modified: java/samples/attachments EchoAttachment.java
java/samples/bidbuy TestClient.java v3.java
java/samples/echo TestClient.java
java/samples/stock GetInfo.java GetQuote.java GetQuote1.java
java/samples/transport FileTest.java
java/samples/transport/tcp GetQuote.java
java/samples/userguide/example2 CalcClient.java
java/samples/userguide/example3 Client.java
java/samples/userguide/example5 Client.java
java/src/javax/xml/rpc Call.java
java/src/org/apache/axis/client Call.java ServiceClient.java
java/src/org/apache/axis/encoding XMLType.java
java/src/org/apache/axis/message RPCHandler.java
java/src/org/apache/axis/utils resources.properties
java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
java/test/functional TestTCPTransportSample.java
java/test/outparams TestOutParams.java
Removed: java/src/javax/xml/rpc/encoding XMLType.java
Log:
Some updates to bring AXIS in line with JAX-RPC:
- Removed javax.xml.rpc.XMLTypes
- Added javax.xml.rpc.ParameterMode
- Modified javax.xml.rpc.Call.
Unfortunately, this rippled quite a bit through the runtime, Wsdl2Java, samples, and
tests.
Revision Changes Path
1.4 +5 -4 xml-axis/java/samples/attachments/EchoAttachment.java
Index: EchoAttachment.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/attachments/EchoAttachment.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EchoAttachment.java 17 Nov 2001 00:06:50 -0000 1.3
+++ EchoAttachment.java 4 Jan 2002 22:30:02 -0000 1.4
@@ -67,6 +67,7 @@
import org.apache.axis.utils.Options;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
+import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import java.net.URL;
@@ -128,10 +129,10 @@
call.addDeserializerFactory(qnameAttachment, dhSource.getClass(),
JAFDataHandlerDeserializer.getFactory());
- call.addParameter( "source", new XMLType(qnameAttachment),
- Call.PARAM_MODE_IN ); //Add the file.
+ call.addParameter( "source", qnameAttachment,
+ ParameterMode.PARAM_MODE_IN ); //Add the file.
- call.setReturnType( new XMLType(qnameAttachment));
+ call.setReturnType( qnameAttachment);
call.setProperty( Transport.USER, opts.getUser());
@@ -221,7 +222,7 @@
JAFDataHandlerDeserializer.getFactory());
call.addParameter( "source", XMLType.SOAP_ARRAY , // new XMLType(qnameAttachment),
- Call.PARAM_MODE_IN ); //Add the file.
+ ParameterMode.PARAM_MODE_IN ); //Add the file.
call.setReturnType(XMLType.SOAP_ARRAY); // new XMLType(qnameAttachment));
1.18 +3 -1 xml-axis/java/samples/bidbuy/TestClient.java
Index: TestClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/bidbuy/TestClient.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TestClient.java 30 Oct 2001 16:46:31 -0000 1.17
+++ TestClient.java 4 Jan 2002 22:30:02 -0000 1.18
@@ -62,6 +62,8 @@
import org.apache.axis.transport.http.HTTPTransport;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
import javax.xml.rpc.namespace.QName;
import java.net.URL;
import java.util.Date;
@@ -126,7 +128,7 @@
// Default return type based on what we expect
call.setOperationName( "Buy" );
call.setProperty( Call.NAMESPACE, "http://www.soapinterop.org/Bid");
- call.addParameter( "PO", new XMLType(poqn), Call.PARAM_MODE_IN );
+ call.addParameter( "PO", poqn, ParameterMode.PARAM_MODE_IN );
call.setReturnType( XMLType.XSD_STRING );
LineItem[] li = new LineItem[2];
1.15 +13 -12 xml-axis/java/samples/bidbuy/v3.java
Index: v3.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/bidbuy/v3.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- v3.java 26 Oct 2001 18:18:57 -0000 1.14
+++ v3.java 4 Jan 2002 22:30:02 -0000 1.15
@@ -6,6 +6,7 @@
import org.apache.axis.encoding.XMLType;
import org.apache.axis.transport.http.HTTPConstants;
+import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import java.math.BigDecimal;
import java.net.URL;
@@ -23,10 +24,10 @@
call.setTargetEndpointAddress( new URL(registryURL) );
call.setProperty( Call.NAMESPACE, "http://www.soapinterop.org/Register");
call.setOperationName( "Register" );
- call.addParameter("ServiceName", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
- call.addParameter("ServiceUrl", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
- call.addParameter("ServiceType", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
- call.addParameter("ServiceWSDL", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
+ call.addParameter("ServiceName", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
+ call.addParameter("ServiceUrl", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
+ call.addParameter("ServiceType", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
+ call.addParameter("ServiceWSDL", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
call.invoke( new Object[] { s.getServiceName(), s.getServiceUrl(),
s.getServiceType(), s.getServiceWsdl() } );
@@ -45,7 +46,7 @@
call.setTargetEndpointAddress( new URL(registryURL) );
call.setProperty(Call.NAMESPACE, "http://www.soapinterop.org/Unregister");
call.setOperationName( "Unregister" );
- call.addParameter( "ServiceName", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
+ call.addParameter( "ServiceName", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
call.invoke( new Object[] { name } );
}
catch( Exception e ) {
@@ -84,7 +85,7 @@
call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION,
"http://www.soapinterop.org/LookupAsString" );
call.setOperationName( "LookupAsString" );
- call.addParameter( "ServiceType", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
+ call.addParameter( "ServiceType", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
call.setReturnType( XMLType.XSD_DOUBLE );
String res= (String) call.invoke( new Object[] { "Bid" } );
@@ -133,8 +134,8 @@
call.setReturnType( XMLType.XSD_DOUBLE );
call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION,
"http://www.soapinterop.org/RequestForQuote" );
- call.addParameter( "ProductName", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
- call.addParameter( "Quantity", XMLType.XSD_INT, Call.PARAM_MODE_IN);
+ call.addParameter( "ProductName", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
+ call.addParameter( "Quantity", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN);
Object r = call.invoke( new Object[] { "widget", new Integer(10) } );
/*
@@ -168,9 +169,9 @@
"http://www.soapinterop.org/SimpleBuy" );
call.setOperationName( "SimpleBuy" );
call.setReturnType( XMLType.XSD_STRING );
- call.addParameter( "Address", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
- call.addParameter( "ProductName", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
- call.addParameter( "Quantity", XMLType.XSD_INT, Call.PARAM_MODE_IN );
+ call.addParameter( "Address", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
+ call.addParameter( "ProductName", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
+ call.addParameter( "Quantity", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN );
String res = (String) call.invoke(new Object[] { "123 Main St.",
"Widget",
@@ -252,7 +253,7 @@
"06883"),
lineItems );
- call.addParameter( "PO", new XMLType(poqn), Call.PARAM_MODE_IN );
+ call.addParameter( "PO", poqn, ParameterMode.PARAM_MODE_IN );
call.setOperationName( "Buy" );
String res = (String) call.invoke( new Object[] { po } );
1.43 +3 -4 xml-axis/java/samples/echo/TestClient.java
Index: TestClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/echo/TestClient.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- TestClient.java 9 Dec 2001 23:20:07 -0000 1.42
+++ TestClient.java 4 Jan 2002 22:30:02 -0000 1.43
@@ -60,11 +60,11 @@
import org.apache.axis.client.Service;
import org.apache.axis.encoding.BeanSerializer;
import org.apache.axis.encoding.TypeMappingRegistry;
-import org.apache.axis.encoding.XMLType;
import org.apache.axis.transport.http.HTTPTransport;
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import java.lang.reflect.Array;
import java.math.BigDecimal;
@@ -157,10 +157,9 @@
// Default return type based on what we expect
QName qn = map.getTypeQName(toSend.getClass());
- XMLType xt = new XMLType( qn );
- call.addParameter( arg, xt, Call.PARAM_MODE_IN);
- call.setReturnType( xt );
+ call.addParameter( arg, qn, ParameterMode.PARAM_MODE_IN);
+ call.setReturnType( qn );
args = new Object[] { toSend } ;
}
1.17 +4 -2 xml-axis/java/samples/stock/GetInfo.java
Index: GetInfo.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/stock/GetInfo.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- GetInfo.java 30 Oct 2001 16:46:32 -0000 1.16
+++ GetInfo.java 4 Jan 2002 22:30:03 -0000 1.17
@@ -63,6 +63,8 @@
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
/**
*
* @author Doug Davis (dug@us.ibm.com.com)
@@ -86,8 +88,8 @@
call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) );
call.setOperationName( "getInfo" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
- call.addParameter( "info", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
+ call.addParameter( "info", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setProperty( Call.NAMESPACE, "urn:cominfo" );
call.setProperty( Transport.USER, opts.getUser() );
call.setProperty( Transport.PASSWORD, opts.getPassword() );
1.35 +3 -1 xml-axis/java/samples/stock/GetQuote.java
Index: GetQuote.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/stock/GetQuote.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- GetQuote.java 20 Nov 2001 20:23:12 -0000 1.34
+++ GetQuote.java 4 Jan 2002 22:30:03 -0000 1.35
@@ -63,6 +63,8 @@
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
import java.net.URL;
/**
@@ -107,7 +109,7 @@
call.setTargetEndpointAddress( url );
call.setOperationName( "getQuote" );
call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setReturnType( XMLType.XSD_FLOAT );
// TESTING HACK BY ROBJ
1.18 +3 -1 xml-axis/java/samples/stock/GetQuote1.java
Index: GetQuote1.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/stock/GetQuote1.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- GetQuote1.java 9 Nov 2001 00:02:56 -0000 1.17
+++ GetQuote1.java 4 Jan 2002 22:30:03 -0000 1.18
@@ -63,6 +63,8 @@
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
import javax.xml.rpc.namespace.QName;
import java.net.URL;
@@ -156,7 +158,7 @@
call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
call.setEncodingStyle( "http://schemas.xmlsoap.org/soap/encoding/" );
call.setOperationName( "getQuote" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setReturnType( XMLType.XSD_FLOAT );
/* Define some service specific properties */
1.22 +3 -1 xml-axis/java/samples/transport/FileTest.java
Index: FileTest.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/transport/FileTest.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- FileTest.java 3 Jan 2002 18:08:28 -0000 1.21
+++ FileTest.java 4 Jan 2002 22:30:03 -0000 1.22
@@ -8,6 +8,8 @@
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
/** Tests the simple File transport. To run:
* java org.apache.axis.utils.Admin client client_deploy.xml
* java org.apache.axis.utils.Admin server deploy.xml
@@ -41,7 +43,7 @@
engine.deployTransport("FileTransport", c);
call.setOperationName( "getQuote" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
call.setReturnType( XMLType.XSD_FLOAT );
call.setTransport( new FileTransport() );
1.15 +3 -1 xml-axis/java/samples/transport/tcp/GetQuote.java
Index: GetQuote.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/transport/tcp/GetQuote.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- GetQuote.java 3 Jan 2002 18:08:28 -0000 1.14
+++ GetQuote.java 4 Jan 2002 22:30:03 -0000 1.15
@@ -64,6 +64,8 @@
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
import java.net.URL;
/**
@@ -101,7 +103,7 @@
call.setTargetEndpointAddress( new URL(opts.getURL()) );
call.setOperationName( "getQuote" );
call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setReturnType( XMLType.XSD_FLOAT );
// TESTING HACK BY ROBJ
1.8 +4 -2 xml-axis/java/samples/userguide/example2/CalcClient.java
Index: CalcClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/userguide/example2/CalcClient.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CalcClient.java 30 Oct 2001 16:46:32 -0000 1.7
+++ CalcClient.java 4 Jan 2002 22:30:03 -0000 1.8
@@ -60,6 +60,8 @@
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
public class CalcClient
{
public static void main(String [] args) throws Exception {
@@ -89,8 +91,8 @@
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( method );
- call.addParameter( "op1", XMLType.XSD_INT, Call.PARAM_MODE_IN );
- call.addParameter( "op2", XMLType.XSD_INT, Call.PARAM_MODE_IN );
+ call.addParameter( "op1", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN );
+ call.addParameter( "op2", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN );
Integer ret = (Integer) call.invoke( new Object [] { i1, i2 });
1.7 +3 -1 xml-axis/java/samples/userguide/example3/Client.java
Index: Client.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/userguide/example3/Client.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Client.java 30 Oct 2001 16:46:32 -0000 1.6
+++ Client.java 4 Jan 2002 22:30:03 -0000 1.7
@@ -60,6 +60,8 @@
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
+
public class Client
{
public static void main(String [] args)
@@ -83,7 +85,7 @@
call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
call.setOperationName( "serviceMethod" );
call.setProperty( Call.NAMESPACE, "MyService" );
- call.addParameter( "arg1", XMLType.XSD_STRING, Call.PARAM_MODE_IN);
+ call.addParameter( "arg1", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN);
String ret = (String) call.invoke( new Object[] { textToSend } );
1.11 +2 -2 xml-axis/java/samples/userguide/example5/Client.java
Index: Client.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/userguide/example5/Client.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Client.java 30 Oct 2001 16:46:33 -0000 1.10
+++ Client.java 4 Jan 2002 22:30:03 -0000 1.11
@@ -58,9 +58,9 @@
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
-import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
public class Client
@@ -91,7 +91,7 @@
call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
call.setProperty( Call.NAMESPACE, "OrderProcessor" );
call.setOperationName( "processOrder" );
- call.addParameter( "arg1", new XMLType(qn), Call.PARAM_MODE_IN );
+ call.addParameter( "arg1", qn, ParameterMode.PARAM_MODE_IN );
result = (String) call.invoke( new Object[] { order } );
} catch (AxisFault fault) {
1.6 +66 -33 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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Call.java 30 Oct 2001 16:46:33 -0000 1.5
+++ Call.java 4 Jan 2002 22:30:03 -0000 1.6
@@ -54,7 +54,8 @@
*/
package javax.xml.rpc;
-import javax.xml.rpc.encoding.XMLType;
+import java.util.Map;
+
import javax.xml.rpc.namespace.QName;
/**
@@ -81,28 +82,14 @@
*/
public interface Call {
- /** Field PARAM_MODE_IN */
- static public final int PARAM_MODE_IN = 1;
-
- /** Field PARAM_MODE_OUT */
- static public final int PARAM_MODE_OUT = 2;
-
- /** Field PARAM_MODE_INOUT */
- static public final int PARAM_MODE_INOUT = 3;
-
/**
- * Method getEncodingStyle
- *
- * @return namespace URI of the Encoding Style
- */
- public String getEncodingStyle();
-
- /**
- * Method setEncodingStyle
- *
- * @param namespaceURI
+ * Is the caller required to provide the parameter and return type specification? If true, then
+ * addParameter and setReturnType MUST be called to provide the meta data. If false, then
+ * addParameter and setReturnType CANNOT be called because the Call object already has the meta
+ * data and the user is not allowed to mess with it. These methods throw JAXRPCException if
+ * this method returns false.
*/
- public void setEncodingStyle(String namespaceURI);
+ public boolean isParameterAndReturnSpecRequired();
/**
* Adds a parameter type and mode for a specific operation. Note that the client code is not required to call any
@@ -112,35 +99,54 @@
* @param paramName - Name of the parameter
* @param paramType - XML datatype of the parameter
* @param parameterMode - Mode of the parameter-whether PARAM_MODE_IN, PARAM_MODE_OUT or PARAM_MODE_INOUT
+ * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns false, then
+ * addParameter will throw JAXRPCException.
*/
- public void addParameter(String paramName, XMLType paramType,
- int parameterMode);
+ public void addParameter(String paramName, QName paramType,
+ ParameterMode parameterMode) throws JAXRPCException;
+
+ /**
+ * Given a parameter name, return the QName of its type. If the parameter doesn't exist, this
+ * method returns null.
+ *
+ * @param paramName - Name of the parameter.
+ */
+ public QName getParameterTypeByName(String paramName);
/**
* Sets the return type for a specific operation.
*
- * @param type - XML data type of the return value
+ * @param xmlType - QName of the data type of the return value
+ * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns false, then
+ * setReturnType will throw JAXRPCException.
*/
- public void setReturnType(XMLType type);
+ public void setReturnType(QName xmlType) throws JAXRPCException;
/**
- * Removes all specified parameters from this Call instance
+ * Get the QName of the return type.
*/
- public void removeAllParameters();
+ public QName getReturnType();
+
+ /**
+ * Removes all specified parameters from this Call instance.
+ * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns false, then
+ * removeAllParameters will throw JAXRPCException.
+ */
+ public void removeAllParameters() throws JAXRPCException;
/**
* Gets the name of the operation to be invoked using this Call instance.
*
- * @return Name of the operation
+ * @return QName of the operation
*/
- public String getOperationName();
+ public QName getOperationName();
/**
* Sets the name of the operation to be invoked using this Call instance.
*
- * @param operationName - Name of the operation to be invoked using the Call instance
+ * @param operationName - QName of the operation to be invoked using the Call instance
*/
- public void setOperationName(String operationName);
+ public void setOperationName(QName operationName);
/**
* Gets the qualified name of the port type.
@@ -216,6 +222,23 @@
* method must check whether the passed parameter values correspond to the number, order and types of parameters
* specified in the corresponding operation specification.
*
+ * @param operationName - Name of the operation to invoke
+ * @param params - Parameters for this invocation
+ *
+ * @return the value returned from the other end.
+ *
+ * @throws java.rmi.RemoteException - if there is any error in the remote method invocation or if the Call
+ * object is not configured properly.
+ */
+ public Object invoke(QName operationName, Object[] params)
+ throws java.rmi.RemoteException;
+
+ /**
+ * Invokes a specific operation using a synchronous request-response interaction mode. The invoke method takes
+ * as parameters the object values corresponding to these defined parameter types. Implementation of the invoke
+ * method must check whether the passed parameter values correspond to the number, order and types of parameters
+ * specified in the corresponding operation specification.
+ *
* @param params - Parameters for this invocation
*
* @return the value returned from the other end.
@@ -236,8 +259,18 @@
* 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 javax.xml.rpc.JAXRPCException;
+ public void invokeOneWay(Object[] params) throws JAXRPCException;
+
+ /**
+ * This method returns a java.util.Map of {name, value} for the PARAM_MODE_OUT and
+ * PARAM_MODE_INOUT parameters for the last invoked operation. If there are no output
+ * parameters, this method returns an empty map. The parameter names in the returned Map are of
+ * type String. The ty0pe of a value depends on the mapping between the Java and XML types.
+ *
+ * @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;
}
1.56 +122 -49 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.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- Call.java 23 Dec 2001 14:52:37 -0000 1.55
+++ Call.java 4 Jan 2002 22:30:03 -0000 1.56
@@ -76,7 +76,6 @@
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.attachments.AttachmentPart;
import org.apache.axis.InternalException;
-import javax.xml.rpc.encoding.XMLType ;
import org.apache.log4j.Category;
@@ -96,6 +95,7 @@
import javax.xml.rpc.namespace.QName;
import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.ParameterMode;
import java.beans.IntrospectionException;
import java.io.PrintWriter;
@@ -131,14 +131,15 @@
public class Call implements javax.xml.rpc.Call {
static Category category = Category.getInstance(Call.class.getName());
+ private boolean parmAndRetReq = true ;
private Service service = null ;
private QName portTypeName = null ;
- private String operationName = null ;
+ private QName operationName = null ;
private Vector paramNames = null ;
private Vector paramTypes = null ;
private Vector paramModes = null ;
private String encodingStyle = null ;
- private XMLType returnType = null ;
+ private QName returnType = null ;
private MessageContext msgContext = null ;
@@ -154,7 +155,7 @@
private String transportName = null ;
// A place to store output parameters
- private Vector outParams = null;
+ private HashMap outParams = null;
// A place to store any client-specified headers
private Vector myHeaders = null;
@@ -225,6 +226,17 @@
}
/**
+ * Is the caller required to provide the parameter and return type specification? If true, then
+ * addParameter and setReturnType MUST be called to provide the meta data. If false, then
+ * addParameter and setReturnType CANNOT be called because the Call object already has the meta
+ * data and the user is not allowed to mess with it. These methods throw JAXRPCException if
+ * this method returns false.
+ */
+ public boolean isParameterAndReturnSpecRequired() {
+ return parmAndRetReq;
+ } // isParameterAndReturnSpecRequired
+
+ /**
* Adds the specified parameter to the list of parameters for the
* operation associated with this Call object.
*
@@ -233,39 +245,42 @@
* @param parameterMode one of PARAM_MODE_IN, PARAM_MODE_OUT
* or PARAM_MODE_INOUT
*/
- public void addParameter(String paramName, XMLType paramType,
- int parameterMode) {
+ public void addParameter(String paramName, QName paramType,
+ ParameterMode parameterMode) throws JAXRPCException {
+ if (parmAndRetReq) {
+
+ if ( paramNames == null ) {
+ paramNames = new Vector();
+ paramTypes = new Vector();
+ paramModes = new Vector();
+ }
- if ( paramNames == null ) {
- paramNames = new Vector();
- paramTypes = new Vector();
- paramModes = new Vector();
- }
+ paramNames.add( paramName );
+ paramTypes.add( paramType );
+ paramModes.add( parameterMode );
- paramNames.add( paramName );
- paramTypes.add( paramType.getType() );
- paramModes.add( new Integer(parameterMode) );
+ }
+ else {
+ throw new JAXRPCException();
+ }
}
/**
- * Return the XMLType of the parameters with the given name.
+ * Return the QName of the type of the parameters with the given name.
*
* Note: Not part of JAX-RPC specification.
*
* @param paramName name of the parameter to return
* @return XMLType XMLType of paramName, or null if not found.
*/
- public XMLType getParameterTypeByName(String paramName) {
+ public QName getParameterTypeByName(String paramName) {
int i ;
if ( paramNames == null ) return( null );
for (i = 0 ; i< paramNames.size() ; i++ )
if ( ((String)paramNames.get(i)).equals(paramName) ) {
- org.apache.axis.encoding.XMLType type ;
- QName qn = (QName) paramTypes.get(i);
- type = new org.apache.axis.encoding.XMLType( qn );
- return( type );
+ return (QName) paramTypes.get(i);
}
return( null );
}
@@ -273,31 +288,43 @@
/**
* Sets the return type of the operation associated with this Call object.
*
- * @param type XMLType of the return value.
+ * @param type QName of the return value type.
*/
- public void setReturnType(XMLType type) {
- returnType = type ;
+ public void setReturnType(QName type) throws JAXRPCException {
+ if (parmAndRetReq) {
+ returnType = type ;
+ }
+ else {
+ throw new JAXRPCException();
+ }
}
/**
- * Returns the XMLType of the return value of this Call - or null if
+ * Returns the QName of the type of the return value of this Call - or null if
* not set.
*
* Note: Not part of JAX-RPC specification.
*
* @return the XMLType specified for this Call (or null).
*/
- public XMLType getReturnType() {
+ public QName getReturnType() {
return( returnType );
}
/**
* Clears the list of parameters.
+ * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns false, then
+ * removeAllParameters will throw JAXRPCException.
*/
- public void removeAllParameters() {
- paramNames = null ;
- paramTypes = null ;
- paramModes = null ;
+ public void removeAllParameters() throws JAXRPCException {
+ if (parmAndRetReq) {
+ paramNames = null ;
+ paramTypes = null ;
+ paramModes = null ;
+ }
+ else {
+ throw new JAXRPCException();
+ }
}
/**
@@ -305,7 +332,7 @@
*
* @return String Name of the operation or null if not set.
*/
- public String getOperationName() {
+ public QName getOperationName() {
return( operationName );
}
@@ -316,10 +343,18 @@
*
* @param opName Name of the operation.
*/
- public void setOperationName(String opName) {
+ public void setOperationName(QName opName) {
operationName = opName ;
}
+ /**
+ * This is a convenience method. If the user doesn't care about the QName of the operation, the
+ * user can call this method, which converts a String operation name to a QName.
+ */
+ public void setOperationName(String opName) {
+ operationName = new QName(opName);
+ }
+
public void setOperation(QName portName, String opName)
throws JAXRPCException{
if ( service == null )
@@ -445,11 +480,10 @@
JavaUtils.getMessage("typeNotSet00", name) );
}
- QName tmpQN = new QName( type.getNamespaceURI(),
- type.getLocalPart());
- XMLType xmlType = new org.apache.axis.encoding.XMLType(tmpQN);
- int mode = Call.PARAM_MODE_IN ;
- this.addParameter( name, xmlType, mode );
+ QName qname = new QName(type.getNamespaceURI(),
+ type.getLocalPart());
+ ParameterMode mode = ParameterMode.PARAM_MODE_IN;
+ this.addParameter( name, qname, mode );
}
}
@@ -479,10 +513,9 @@
throw new JAXRPCException(
JavaUtils.getMessage("typeNotSet00", "<return>") );
}
- QName tmpQN = new QName( type.getNamespaceURI(),
- type.getLocalPart());
- XMLType xmlType = new org.apache.axis.encoding.XMLType(tmpQN);
- this.setReturnType( xmlType );
+ QName qname = new QName(type.getNamespaceURI(),
+ type.getLocalPart());
+ this.setReturnType( qname );
break ;
}
}
@@ -620,6 +653,41 @@
}
/**
+ * Invokes a specific operation using a synchronous request-response interaction mode. The invoke method takes
+ * as parameters the object values corresponding to these defined parameter types. Implementation of the invoke
+ * method must check whether the passed parameter values correspond to the number, order and types of parameters
+ * specified in the corresponding operation specification.
+ *
+ * @param operationName - Name of the operation to invoke
+ * @param params - Parameters for this invocation
+ *
+ * @return the value returned from the other end.
+ *
+ * @throws java.rmi.RemoteException - if there is any error in the remote method invocation or if the Call
+ * object is not configured properly.
+ */
+ public Object invoke(QName operationName, Object[] params)
+ throws java.rmi.RemoteException {
+ QName origOpName = this.operationName;
+ this.operationName = operationName;
+ try {
+ return this.invoke(params);
+ }
+ catch (java.rmi.RemoteException re) {
+ this.operationName = origOpName;
+ throw re;
+ }
+ catch (RuntimeException re) {
+ this.operationName = origOpName;
+ throw re;
+ }
+ catch (Error e) {
+ this.operationName = origOpName;
+ throw e;
+ }
+ } // invoke
+
+ /**
* Invokes the operation associated with this Call object using the
* passed in parameters as the arguments to the method.
*
@@ -673,10 +741,14 @@
throw new AxisFault( JavaUtils.getMessage("noOperation00") );
try {
String ns = (String) getProperty( Call.NAMESPACE );
- if ( ns == null )
- return( this.invoke(operationName,getParamList(params)) );
- else
- return( this.invoke(ns,operationName,getParamList(params)) );
+ if ( ns == null ) {
+ return this.invoke(
+ operationName.getLocalPart(), getParamList(params));
+ }
+ else {
+ return this.invoke(
+ ns, operationName.getLocalPart(), getParamList(params));
+ }
}
catch( AxisFault af) {
throw af;
@@ -830,7 +902,7 @@
// number of params passed in - if not throw an error
/////////////////////////////////////////////////////////////////////
for ( i = 0 ; i < paramNames.size() ; i++ ) {
- if (((Integer)paramModes.get(i)).intValue() == Call.PARAM_MODE_OUT)
+ if (paramModes.get(i) == ParameterMode.PARAM_MODE_OUT)
continue ;
numParams++ ;
}
@@ -845,7 +917,7 @@
Vector result = new Vector();
int j = 0 ;
for ( i = 0 ; i < numParams ; i++ ) {
- if (((Integer)paramModes.get(i)).intValue() == Call.PARAM_MODE_OUT)
+ if (paramModes.get(i) == ParameterMode.PARAM_MODE_OUT)
continue ;
RPCParam p = new RPCParam( (String) paramNames.get(i),
params[j++] );
@@ -1142,9 +1214,10 @@
* Are there out-params? If so, return a Vector instead.
*/
if (resArgs.size() > 1) {
- outParams = new Vector();
+ outParams = new HashMap();
for (int i = 1; i < resArgs.size(); i++) {
- outParams.add(resArgs.get(i));
+ param = (RPCParam) resArgs.get(i);
+ outParams.put(param.getName(), param.getValue());
}
}
}
@@ -1317,7 +1390,7 @@
*
* @return Vector of RPCParams
*/
- public Vector getOutputParams()
+ public Map getOutputParams()
{
return this.outParams;
}
1.71 +3 -3 xml-axis/java/src/org/apache/axis/client/ServiceClient.java
Index: ServiceClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceClient.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- ServiceClient.java 23 Dec 2001 12:33:31 -0000 1.70
+++ ServiceClient.java 4 Jan 2002 22:30:03 -0000 1.71
@@ -71,7 +71,7 @@
import java.beans.IntrospectionException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Vector;
+import java.util.Map;
/**
* Allows an Axis service to be invoked from the client side.
@@ -365,9 +365,9 @@
* name and value - if you want the value, you'll need to call
* param.getValue().
*
- * @return a Vector of RPCParams
+ * @return a Map of RPCParams
*/
- public Vector getOutputParams()
+ public Map getOutputParams()
{
return call.getOutputParams();
}
1.12 +36 -46 xml-axis/java/src/org/apache/axis/encoding/XMLType.java
Index: XMLType.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/XMLType.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLType.java 11 Dec 2001 18:40:33 -0000 1.11
+++ XMLType.java 4 Jan 2002 22:30:03 -0000 1.12
@@ -65,56 +65,46 @@
import javax.xml.rpc.namespace.QName;
-public class XMLType implements javax.xml.rpc.encoding.XMLType {
- private QName type ;
+public class XMLType {
+ public static final QName XSD_STRING = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "string");
+ public static final QName XSD_BOOLEAN = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "boolean");
+ public static final QName XSD_DOUBLE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "double");
+ public static final QName XSD_FLOAT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "float");
+ public static final QName XSD_INT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "int");
+ public static final QName XSD_LONG = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "long");
+ public static final QName XSD_SHORT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "short");
+ public static final QName XSD_BYTE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "byte");
+ public static final QName XSD_DECIMAL = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "decimal");
+ public static final QName XSD_BASE64 = new QName(Constants.URI_2001_SCHEMA_XSD, "base64Binary");
+// public static final QName XSD_HEXBIN = new QName(Constants.URI_2001_SCHEMA_XSD, "hexBinary");
+ public static final QName XSD_ANYTYPE = new QName(Constants.URI_2001_SCHEMA_XSD, "anyType");
+ public static final QName SOAP_BASE64 = new QName(Constants.URI_SOAP_ENC, "base64");
+
+ public static final QName SOAP_STRING = new QName(Constants.URI_SOAP_ENC, "string");
+ public static final QName SOAP_BOOLEAN = new QName(Constants.URI_SOAP_ENC, "boolean");
+ public static final QName SOAP_DOUBLE = new QName(Constants.URI_SOAP_ENC, "double");
+ public static final QName SOAP_FLOAT = new QName(Constants.URI_SOAP_ENC, "float");
+ public static final QName SOAP_INT = new QName(Constants.URI_SOAP_ENC, "int");
+ public static final QName SOAP_LONG = new QName(Constants.URI_SOAP_ENC, "long");
+ public static final QName SOAP_SHORT = new QName(Constants.URI_SOAP_ENC, "short");
+ public static final QName SOAP_BYTE = new QName(Constants.URI_SOAP_ENC, "byte");
+ public static final QName SOAP_ARRAY = new QName(Constants.URI_SOAP_ENC, "Array");
- public static final XMLType XSD_STRING = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "string"));
- public static final XMLType XSD_BOOLEAN = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "boolean"));
- public static final XMLType XSD_DOUBLE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "double"));
- public static final XMLType XSD_FLOAT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "float"));
- public static final XMLType XSD_INT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "int"));
- public static final XMLType XSD_LONG = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "long"));
- public static final XMLType XSD_SHORT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "short"));
- public static final XMLType XSD_BYTE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "byte"));
- public static final XMLType XSD_DECIMAL = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "decimal"));
- public static final XMLType XSD_BASE64 = new XMLType(new QName(Constants.URI_2001_SCHEMA_XSD, "base64Binary"));
-// public static final XMLType XSD_HEXBIN = new XMLType(new QName(Constants.URI_2001_SCHEMA_XSD, "hexBinary"));
- public static final XMLType XSD_ANYTYPE = new XMLType(new QName(Constants.URI_2001_SCHEMA_XSD, "anyType"));
- public static final XMLType SOAP_BASE64 = new XMLType(new QName(Constants.URI_SOAP_ENC, "base64"));
+ public static final QName TYPE_MAP = new QName("http://xml.apache.org/xml-soap", "Map");
+ public static final QName TYPE_ELEMENT = new QName("http://xml.apache.org/xml-soap", "Element");
- public static final XMLType SOAP_STRING = new XMLType(new QName(Constants.URI_SOAP_ENC, "string"));
- public static final XMLType SOAP_BOOLEAN = new XMLType(new QName(Constants.URI_SOAP_ENC, "boolean"));
- public static final XMLType SOAP_DOUBLE = new XMLType(new QName(Constants.URI_SOAP_ENC, "double"));
- public static final XMLType SOAP_FLOAT = new XMLType(new QName(Constants.URI_SOAP_ENC, "float"));
- public static final XMLType SOAP_INT = new XMLType(new QName(Constants.URI_SOAP_ENC, "int"));
- public static final XMLType SOAP_LONG = new XMLType(new QName(Constants.URI_SOAP_ENC, "long"));
- public static final XMLType SOAP_SHORT = new XMLType(new QName(Constants.URI_SOAP_ENC, "short"));
- public static final XMLType SOAP_BYTE = new XMLType(new QName(Constants.URI_SOAP_ENC, "byte"));
- public static final XMLType SOAP_ARRAY = new XMLType(new QName(Constants.URI_SOAP_ENC, "Array"));
-
- public static final XMLType TYPE_MAP = new XMLType(new QName("http://xml.apache.org/xml-soap", "Map"));
- public static final XMLType TYPE_ELEMENT = new XMLType(new QName("http://xml.apache.org/xml-soap", "Element"));
-
- public static XMLType XSD_DATE;
+ public static QName XSD_DATE;
static {
- if (Constants.URI_CURRENT_SCHEMA_XSD.equals(Constants.URI_1999_SCHEMA_XSD))
- XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant"));
- else if (Constants.URI_CURRENT_SCHEMA_XSD.equals(Constants.URI_2000_SCHEMA_XSD))
- XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant"));
+ if (Constants.URI_CURRENT_SCHEMA_XSD.equals(
+ Constants.URI_1999_SCHEMA_XSD))
+ XSD_DATE =
+ new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant");
+ else if (Constants.URI_CURRENT_SCHEMA_XSD.equals(
+ Constants.URI_2000_SCHEMA_XSD))
+ XSD_DATE =
+ new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant");
else
- XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "dateTime"));
- }
-
- public XMLType(QName type) {
- this.type = type ;
- }
-
- public QName getType() {
- return( type );
- }
-
- public void setType(QName type) {
- this.type = type ;
+ XSD_DATE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "dateTime");
}
}
1.22 +3 -10 xml-axis/java/src/org/apache/axis/message/RPCHandler.java
Index: RPCHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- RPCHandler.java 10 Dec 2001 19:31:05 -0000 1.21
+++ RPCHandler.java 4 Jan 2002 22:30:03 -0000 1.22
@@ -68,7 +68,6 @@
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.TypeMappingRegistry;
-import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.AxisClassLoader;
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.utils.cache.JavaClass;
@@ -194,19 +193,13 @@
if ( msg != null && msg.getMessageType() == Message.RESPONSE ) {
Call c = (Call) msgContext.getProperty( MessageContext.CALL );
if ( c != null ) {
- XMLType xmlType = null ;
-
// First look for this param by name
- xmlType = (XMLType) c.getParameterTypeByName(localName);
+ type = c.getParameterTypeByName(localName);
// If we can't find it by name then assume it must
// be the return type - is this correct/safe????
- if ( xmlType == null )
- xmlType = (XMLType) c.getReturnType();
-
- // Now get the QName
- if ( xmlType != null )
- type = xmlType.getType();
+ if ( type == null )
+ type = c.getReturnType();
}
}
1.36 +4 -0 xml-axis/java/src/org/apache/axis/utils/resources.properties
Index: resources.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- resources.properties 3 Jan 2002 20:33:43 -0000 1.35
+++ resources.properties 4 Jan 2002 22:30:03 -0000 1.36
@@ -21,6 +21,10 @@
badAuth00=Bad authentication type (I can only handle "Basic").
badBool00=Invalid boolean
+
+# NOTE: in badCall00, do not translate "Call"
+badCall00=Cannot update the Call object
+
badChars00=Unexpected characters
badChars01=Bad character or insufficient number of characters in hex string
badCompile00=Error while compiling: {0}
1.9 +20 -15 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JavaStubWriter.java 20 Dec 2001 17:50:14 -0000 1.8
+++ JavaStubWriter.java 4 Jan 2002 22:30:03 -0000 1.9
@@ -383,7 +383,8 @@
pw.println(" if (call.getProperty(org.apache.axis.transport.http.HTTPTransport.URL) == null) {");
pw.println(" throw new org.apache.axis.NoEndPointException();");
pw.println(" }");
- pw.println(" call.removeAllParameters();");
+ pw.println(" try {");
+ pw.println(" call.removeAllParameters();");
// DUG: need to set the isRPC flag in the Call object
@@ -393,27 +394,34 @@
QName qn = p.type.getQName();
- String typeString = "new org.apache.axis.encoding.XMLType( new javax.xml.rpc.namespace.QName(\"" + qn.getNamespaceURI() + "\", \"" +
- qn.getLocalPart() + "\"))";
+ String typeString = "new javax.xml.rpc.namespace.QName(\"" +
+ qn.getNamespaceURI() + "\", \"" +
+ qn.getLocalPart() + "\")";
if (p.mode == Parameter.IN) {
- pw.println(" call.addParameter(\"" + p.name + "\", " + typeString + ", org.apache.axis.client.Call.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 + ", call.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 + ", call.PARAM_MODE_OUT);");
+ pw.println(" call.addParameter(\"" + p.name + "\", " + typeString + ", javax.xml.rpc.ParameterMode.PARAM_MODE_OUT);");
}
}
// set output type
if (parms.returnType != null) {
QName qn = parms.returnType.getQName();
- String outputType = "new org.apache.axis.encoding.XMLType(new javax.xml.rpc.namespace.QName(\"" + qn.getNamespaceURI() + "\", \"" +
- qn.getLocalPart() + "\"))";
- pw.println(" call.setReturnType(" + outputType + ");");
+ String outputType = "new javax.xml.rpc.namespace.QName(\"" +
+ qn.getNamespaceURI() + "\", \"" +
+ qn.getLocalPart() + "\")";
+ pw.println(" call.setReturnType(" + outputType + ");");
pw.println();
}
+ pw.println(" }");
+ pw.println(" catch (javax.xml.rpc.JAXRPCException jre) {");
+ pw.println(" throw new java.rmi.RemoteException(\"" +
+ JavaUtils.getMessage("badCall00") + "\");");
+ pw.println(" }");
// SoapAction and Namespace
if (soapAction != null) {
@@ -508,8 +516,7 @@
// call.getOutputParams (). Pull the Objects from the appropriate place -
// resp or call.getOutputParms - and put them in the appropriate place,
// either in a holder or as the return value.
- pw.println(" java.util.Vector output = call.getOutputParams();");
- int outdex = 0;
+ pw.println(" java.util.Map output = call.getOutputParams();");
boolean firstInoutIsResp = (parms.outputs == 0);
for (int i = 0; i < parms.list.size (); ++i) {
Parameter p = (Parameter) parms.list.get (i);
@@ -542,15 +549,13 @@
pw.println (" " + javifiedName
+ ".value = (" + p.type.getName()
+ ") org.apache.axis.utils.JavaUtils.convert("
- + "((org.apache.axis.message.RPCParam) output.get("
- + outdex++ + ")).getValue(), "
+ + "output.get(\"" + p.name + "\"), "
+ p.type.getName() + ".class);");
}
else {
pw.println (" " + javifiedName
+ ".value = " + getResponseString(p.type,
- "((org.apache.axis.message.RPCParam) output.get("
- + outdex++ + ")).getValue()"));
+ "output.get(\"" + p.name + "\")"));
}
}
}
1.18 +3 -1 xml-axis/java/test/functional/TestTCPTransportSample.java
Index: TestTCPTransportSample.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/functional/TestTCPTransportSample.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TestTCPTransportSample.java 3 Jan 2002 18:08:28 -0000 1.17
+++ TestTCPTransportSample.java 4 Jan 2002 22:30:03 -0000 1.18
@@ -67,6 +67,8 @@
import samples.transport.tcp.GetQuote;
import samples.transport.tcp.TCPSender;
+import javax.xml.rpc.ParameterMode;
+
import java.net.URL;
/** Test the stock sample code.
@@ -105,7 +107,7 @@
call.setTargetEndpointAddress( new URL("tcp://localhost:8088") );
call.setOperationName( "getQuote" );
call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
- call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
+ call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN );
call.setReturnType( XMLType.XSD_FLOAT );
Object ret = call.invoke(
1.8 +6 -6 xml-axis/java/test/outparams/TestOutParams.java
Index: TestOutParams.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/outparams/TestOutParams.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestOutParams.java 9 Nov 2001 00:02:56 -0000 1.7
+++ TestOutParams.java 4 Jan 2002 22:30:04 -0000 1.8
@@ -14,7 +14,7 @@
import org.apache.axis.server.AxisServer;
import org.apache.axis.transport.local.LocalTransport;
-import java.util.Vector;
+import java.util.Map;
/**
* Test org.apache.axis.handlers.RPCDispatcher
@@ -76,14 +76,14 @@
Object ret = client.invoke(serviceURN, "method",
new Object [] { "test" });
- Vector outParams = client.getOutputParams();
+ Map outParams = client.getOutputParams();
assertNotNull("No output Params returned!", outParams);
- RPCParam param = (RPCParam)outParams.get(0);
- assertEquals("Param 0 does not equal expected value", param.getValue(), ServiceHandler.OUTPARAM1);
+ Object param = outParams.get("out1");
+ assertEquals("Param 0 does not equal expected value", param, ServiceHandler.OUTPARAM1);
- param = (RPCParam)outParams.get(1);
- assertEquals("Param 1 does not equal expected value", param.getValue(), ServiceHandler.OUTPARAM2);
+ param = outParams.get("out2");
+ assertEquals("Param 1 does not equal expected value", param, ServiceHandler.OUTPARAM2);
assertEquals("Return value does not equal expected value", ((Integer)ret).intValue(), ServiceHandler.RESPONSE.intValue());
}
|