We (Russell, Rich and I) talked off-line and Rich is going to change
it so that we can reuse _any_ Call object regardless of how it was
created. The spec doesn't mandate that they are not changeable,
the closest it comes is to say certain methods _MAY_ throw an
exception in certain cases, not MUST. Now, if the TCK decides
to treat it as a MUST then we should get _them_ to change not us.
:-)
-Dug
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Re: cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
Doug,
You can still re-use Call objects there were created with
Service.createCall().
But if you set up a Call object that was created specifically with
Service.createCall(portName, operationName), then you are
binding the Call to a specific operation and it cannot be reused for a
different operation.
Does that satisfy your concern ?
Rich 'Shirley' Scheuerle
IBM WebSphere & Axis Web Services Development
512-838-5115 (IBM TL 678-5115)
Doug Davis/Raleigh/IBM@IBMUS
06/21/2002 11:53 AM
Please respond to axis-dev
- To: [EMAIL PROTECTED]
cc:
Subject: Re: cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
objects????
If so, -1!!! We do that all the time!
-Dug
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
scheu 2002/06/21 09:49:00
Modified: java/samples/jaxrpc GetQuote1.java
java/src/org/apache/axis/client Call.java
Log:
This fix is required for TCK compliance (Service Test).
Problem:
When the Call object is set up via the setOperation(...) method, the
parmAndRetReq flag was not being set to false. This caused the
TCK client to illegally addParameters to an already initialized
OperationDesc...ultimately causing Call.invoke to thrown an exception.
Solution:
When the Call object is set up via the setOperation(...) method, the
parmAndRetReq flag is now set to false to indicate that the parameters
and return have been set up.
This caused a problem in one of the getQuote samples which was attempting
to reuse a call object (set up via setOperation(...)) to invoke a
different operation. Russell and I agreed that this sample method should
be
removed since it is trying to change a Call object which was created
as immutable.
Revision Changes Path
1.4 +0 -59 xml-axis/java/samples/jaxrpc/GetQuote1.java
Index: GetQuote1.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/jaxrpc/GetQuote1.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GetQuote1.java 11 Jun 2002 14:53:49 -0000 1.3
+++ GetQuote1.java 21 Jun 2002 16:48:59 -0000 1.4
@@ -173,58 +173,6 @@
return ((Float) result).floatValue();
} // getQuote2
- /**
- * This method does the same thing that getQuote1 does, but in
- * addition it reuses the Call object to make another call.
- */
- public float getQuote3(String args[]) throws Exception {
- Options opts = new Options(args);
-
- args = opts.getRemainingArgs();
-
- if (args == null) {
- System.err.println("Usage: GetQuote <symbol>");
- System.exit(1);
- }
-
- /* Define the service QName and port QName */
- /*******************************************/
- QName servQN = new QName("urn:xmltoday-delayed-quotes",
- "GetQuoteService");
- QName portQN = new QName("urn:xmltoday-delayed-quotes",
"GetQuote");
-
- /* Now use those QNames as pointers into the WSDL doc */
- /******************************************************/
- Service service = ServiceFactory.newInstance().createService(
- new URL("file:samples/stock/GetQuote.wsdl"), servQN);
- Call call = service.createCall(portQN, "getQuote");
-
- /* Strange - but allows the user to change just certain portions
of */
- /* the URL we're gonna use to invoke the service. Useful when
you */
- /* want to run it thru tcpmon (ie. put -p81 on the cmd line).
*/
- /********************************************************************/
- opts.setDefaultURL(call.getTargetEndpointAddress());
- call.setTargetEndpointAddress(opts.getURL());
-
- /* Define some service specific properties */
- /*******************************************/
- call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
- call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());
-
- /* Get symbol and invoke the service */
- /*************************************/
- Object result = call.invoke(new Object[] {symbol = args[0]});
-
- /* Reuse the Call object for a different call */
- /**********************************************/
- call.setOperationName(new QName("urn:xmltoday-delayed-quotes",
"test"));
- call.removeAllParameters();
- call.setReturnType(XMLType.XSD_STRING);
-
- System.out.println(call.invoke(new Object[]{}));
- return ((Float) result).floatValue();
- } // getQuote3
-
public static void main(String args[]) throws Exception {
String save_args[] = new String[args.length];
float val;
@@ -242,13 +190,6 @@
System.out.println("Manually");
System.arraycopy(save_args, 0, args, 0, args.length);
val = gq.getQuote2(args);
- System.out.println(gq.symbol + ": " + val);
-
- /* Call the getQuote() that uses Axis's generated WSDL */
- /*******************************************************/
- System.out.println("WSDL + Reuse Call");
- System.arraycopy(save_args, 0, args, 0, args.length);
- val = gq.getQuote3(args);
System.out.println(gq.symbol + ": " + val);
} // main
}
1.144 +5 -0 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.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- Call.java 20 Jun 2002 20:35:46 -0000 1.143
+++ Call.java 21 Jun 2002 16:49:00 -0000 1.144
@@ -1071,6 +1071,11 @@
break ;
}
}
+
+ // Indicate that the parameters and return no longer
+ // need to be specified with addParameter calls.
+ parmAndRetReq = false;
+ return;
}
/**