Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 36875 invoked by uid 500); 14 Jun 2002 18:30:34 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 36866 invoked by uid 500); 14 Jun 2002 18:30:33 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 14 Jun 2002 16:43:52 -0000 Message-ID: <20020614164352.98775.qmail@icarus.apache.org> From: dims@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/client Call.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dims 2002/06/14 09:43:52 Modified: java/src/org/apache/axis/client Call.java Log: Improve invokeOneWay for TCK compliance. Revision Changes Path 1.137 +32 -6 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.136 retrieving revision 1.137 diff -u -r1.136 -r1.137 --- Call.java 14 Jun 2002 13:27:17 -0000 1.136 +++ Call.java 14 Jun 2002 16:43:52 -0000 1.137 @@ -166,6 +166,9 @@ private OperationDesc operation = new OperationDesc(); + // Is this a one-way call? + private boolean invokeOneWay = false; + // Our Transport, if any private Transport transport = null ; private String transportName = null ; @@ -1200,10 +1203,12 @@ */ public void invokeOneWay(Object[] params) { try { + invokeOneWay = true; invoke( params ); - } - catch( Exception exp ) { + } catch( Exception exp ) { throw new JAXRPCException( exp.toString() ); + } finally { + invokeOneWay = false; } } @@ -1672,7 +1677,7 @@ * parameter types, check for this case right now and toss a fault * if things don't look right. */ - if (operation.getNumParams() > 0 && returnType == null) { + if (!invokeOneWay && operation.getNumParams() > 0 && returnType == null) { throw new AxisFault(JavaUtils.getMessage("mustSpecifyReturnType")); } @@ -1924,7 +1929,18 @@ log.debug(writer.getBuffer().toString()); } } + if(!invokeOneWay) { + invokeEngine(msgContext); + } else { + invokeEngineOneWay(msgContext); + } + if (log.isDebugEnabled()) { + log.debug("Exit: Call::invoke()"); + } + } + + private void invokeEngine(MessageContext msgContext) throws AxisFault { service.getEngine().invoke( msgContext ); if (transport != null) @@ -1950,10 +1966,20 @@ if (respBody instanceof SOAPFaultElement) { throw ((SOAPFaultElement)respBody).getFault(); } + } - if (log.isDebugEnabled()) { - log.debug("Exit: Call::invoke()"); - } + private void invokeEngineOneWay(final MessageContext msgContext) throws AxisFault { + Runnable runnable = new Runnable(){ + public void run() { + try { + service.getEngine().invoke( msgContext ); + } catch (AxisFault af){ + log.debug(JavaUtils.getMessage("exceptionPrinting"), af); + } + } + }; + Thread thread = new Thread(runnable); + thread.start(); } /**