axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <bu...@us.ibm.com>
Subject Re: Junit fix - RE: cvs commit: xml-axis/java/src/org/apache/axis/pro viders/java RPCProvider.java
Date Fri, 10 May 2002 14:42:52 GMT
Thanks.  That did it.

Russell Butek
butek@us.ibm.com


Glen Daniels <gdaniels@macromedia.com> on 05/10/2002 09:13:51 AM

Please respond to axis-dev@xml.apache.org

To:    "'axis-dev@xml.apache.org'" <axis-dev@xml.apache.org>
cc:
Subject:    Junit fix - RE: cvs commit:
       xml-axis/java/src/org/apache/axis/pro    viders/java
       RPCProvider.java




Hey, Russell, this should fix the junit tests.

--G

> -----Original Message-----
> From: gdaniels@apache.org [mailto:gdaniels@apache.org]
> Sent: Friday, May 10, 2002 10:11 AM
> To: xml-axis-cvs@apache.org
> Subject: cvs commit: xml-axis/java/src/org/apache/axis/providers/java
> RPCProvider.java
>
>
> gdaniels    02/05/10 07:10:59
>
>   Modified:    java/src/org/apache/axis/providers/java
> RPCProvider.java
>   Log:
>   Checked in wrong version of file - oops!
>
>   Revision  Changes    Path
>   1.58      +69 -70
> xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java
>
>   Index: RPCProvider.java
>   ===================================================================
>   RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/RPC
> Provider.java,v
>   retrieving revision 1.57
>   retrieving revision 1.58
>   diff -u -r1.57 -r1.58
>   --- RPCProvider.java      10 May 2002 13:22:00 -0000    1.57
>   +++ RPCProvider.java      10 May 2002 14:10:58 -0000    1.58
>   @@ -143,6 +143,7 @@
>
>            if (body == null) {
>                // throw something
>   +            throw new Exception();
>            }
>            String methodName = body.getMethodName();
>            Vector args = body.getParams();
>   @@ -175,87 +176,85 @@
>            // Make sure we respect parameter ordering if we
> know about it
>            // from metadata, and handle whatever conversions
> are necessary
>            // (values -> Holders, etc)
>   -        if ( args != null && args.size() > 0 ) {
>   -            for ( int i = 0 ; i < numArgs ; i++ ) {
>   -                RPCParam rpcParam = (RPCParam)args.get(i);
>   -                Object value = rpcParam.getValue();
>   -                ParameterDesc paramDesc = rpcParam.getParamDesc();
>   -                if (paramDesc != null &&
> paramDesc.getJavaType() != null) {
>   -                    value = JavaUtils.convert(value,
>   -
> paramDesc.getJavaType());
>   -                    rpcParam.setValue(value);
>   -                    if (paramDesc.getMode() == ParameterDesc.INOUT)
>   -                        outs.add(rpcParam);
>   -                }
>   -                if (paramDesc == null ||
> paramDesc.getOrder() == -1) {
>   -                    argValues[i]  = value;
>   -                } else {
>   -                    argValues[paramDesc.getOrder()] = value;
>   -                }
>   +        for ( int i = 0 ; i < numArgs ; i++ ) {
>   +            RPCParam rpcParam = (RPCParam)args.get(i);
>   +            Object value = rpcParam.getValue();
>   +            ParameterDesc paramDesc = rpcParam.getParamDesc();
>   +            if (paramDesc != null &&
> paramDesc.getJavaType() != null) {
>   +                value = JavaUtils.convert(value,
>   +                                          paramDesc.getJavaType());
>   +                rpcParam.setValue(value);
>   +                if (paramDesc.getMode() == ParameterDesc.INOUT)
>   +                    outs.add(rpcParam);
>   +            }
>   +            if (paramDesc == null || paramDesc.getOrder() == -1) {
>   +                argValues[i]  = value;
>   +            } else {
>   +                argValues[paramDesc.getOrder()] = value;
>   +            }
>
>   -                if (log.isDebugEnabled()) {
>   -                    log.debug("  " +
> JavaUtils.getMessage("value00",
>   -
> "" + argValues[i]) );
>   -                }
>   +            if (log.isDebugEnabled()) {
>   +                log.debug("  " + JavaUtils.getMessage("value00",
>   +                                                      "" +
> argValues[i]) );
>                }
>   +        }
>
>   -            // Check if we can find a Method by this name
>   -            // FIXME : Shouldn't this type of thing have
> already occurred?
>   -            checkMethodName(msgContext, allowedMethods,
> operation.getName());
>   -
>   -            // Now create any out holders we need to pass in
>   -            if (numArgs < argValues.length) {
>   -                ArrayList outParams = operation.getOutParams();
>   -                for (int i = 0; i < outParams.size(); i++) {
>   -                    ParameterDesc param =
> (ParameterDesc)outParams.get(i);
>   -                    Class holderClass = param.getJavaType();
>   -                    if
> (Holder.class.isAssignableFrom(holderClass)) {
>   -                        argValues[numArgs + i] =
> holderClass.newInstance();
>   -                        // Store an RPCParam in the outs
> collection so we
>   -                        // have an easy and consistent way
> to write these
>   -                        // back to the client below
>   -                        outs.add(new RPCParam(param.getQName(),
>   -
> argValues[numArgs + i]));
>   -                    } else {
>   -                        // !!! Throw a fault here?
>   -                    }
>   +        // Check if we can find a Method by this name
>   +        // FIXME : Shouldn't this type of thing have
> already occurred?
>   +        checkMethodName(msgContext, allowedMethods,
> operation.getName());
>   +
>   +        // Now create any out holders we need to pass in
>   +        if (numArgs < argValues.length) {
>   +            ArrayList outParams = operation.getOutParams();
>   +            for (int i = 0; i < outParams.size(); i++) {
>   +                ParameterDesc param =
> (ParameterDesc)outParams.get(i);
>   +                Class holderClass = param.getJavaType();
>   +                if (Holder.class.isAssignableFrom(holderClass)) {
>   +                    argValues[numArgs + i] =
> holderClass.newInstance();
>   +                    // Store an RPCParam in the outs
> collection so we
>   +                    // have an easy and consistent way to
> write these
>   +                    // back to the client below
>   +                    outs.add(new RPCParam(param.getQName(),
>   +                                          argValues[numArgs + i]));
>   +                } else {
>   +                    // !!! Throw a fault here?
>                    }
>                }
>   +        }
>
>   -            // OK!  Now we can invoke the method
>   -            Object objRes =
> operation.getMethod().invoke(obj, argValues);
>   +        // OK!  Now we can invoke the method
>   +        Object objRes = operation.getMethod().invoke(obj,
> argValues);
>
>   -            /* Now put the result in the result SOAPEnvelope */
>   -            /*************************************************/
>   -            RPCElement resBody = new RPCElement(methodName
> + "Response");
>   -            resBody.setPrefix( body.getPrefix() );
>   -            resBody.setNamespaceURI( body.getNamespaceURI() );
>   -
> resBody.setEncodingStyle(msgContext.getEncodingStyle());
>   -
>   -            // Return first
>   -            if ( operation.getMethod().getReturnType() !=
> Void.TYPE ) {
>   -                QName returnQName = operation.getReturnQName();
>   -                if (returnQName == null) {
>   -                    returnQName = new QName("", methodName
> + "Return");
>   -                }
>   -                RPCParam param = new RPCParam(returnQName, objRes);
>   -                param.setParamDesc(operation.getReturnParamDesc());
>   -                resBody.addParam(param);
>   +        /* Now put the result in the result SOAPEnvelope */
>   +        /*************************************************/
>   +        RPCElement resBody = new RPCElement(methodName +
> "Response");
>   +        resBody.setPrefix( body.getPrefix() );
>   +        resBody.setNamespaceURI( body.getNamespaceURI() );
>   +        resBody.setEncodingStyle(msgContext.getEncodingStyle());
>   +
>   +        // Return first
>   +        if ( operation.getMethod().getReturnType() != Void.TYPE ) {
>   +            QName returnQName = operation.getReturnQName();
>   +            if (returnQName == null) {
>   +                returnQName = new QName("", methodName + "Return");
>                }
>   +            RPCParam param = new RPCParam(returnQName, objRes);
>   +            param.setParamDesc(operation.getReturnParamDesc());
>   +            resBody.addParam(param);
>   +        }
>
>   -            // Then any other out params
>   -            if (!outs.isEmpty()) {
>   -                for (Iterator i = outs.iterator(); i.hasNext();) {
>   -                    // We know this has a holder, so just
> unwrap the value
>   -                    RPCParam param = (RPCParam) i.next();
>   -                    Holder holder = (Holder)param.getValue();
>   -
> param.setValue(JavaUtils.getHolderValue(holder));
>   -                    resBody.addParam(param);
>   -                }
>   +        // Then any other out params
>   +        if (!outs.isEmpty()) {
>   +            for (Iterator i = outs.iterator(); i.hasNext();) {
>   +                // We know this has a holder, so just
> unwrap the value
>   +                RPCParam param = (RPCParam) i.next();
>   +                Holder holder = (Holder)param.getValue();
>   +                param.setValue(JavaUtils.getHolderValue(holder));
>   +                resBody.addParam(param);
>                }
>   -
>   -            resEnv.addBodyElement(resBody);
>            }
>   +
>   +        resEnv.addBodyElement(resBody);
>        }
>
>        protected Method[] getMethod(MessageContext msgContext,
>
>
>
>



Mime
View raw message