butek 2002/06/21 07:48:39 Modified: java/src/org/apache/axis/description ParameterDesc.java ServiceDesc.java java/test/wsdl Wsdl2javaTestSuite.xml java/test/wsdl/roundtrip RoundtripPortType.java RoundtripTestServiceTestCase.java RoundtripTestSoapBindingImpl.java Added: java/test/wsdl/roundtrip/holders BondInvestmentHolder.java Log: Fixed http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10103 Java2WSDL didn't work with Holders. It used to. It now does again. And this time I've added a method to the roundtrip test to make sure it continues to work. Revision Changes Path 1.11 +5 -2 xml-axis/java/src/org/apache/axis/description/ParameterDesc.java Index: ParameterDesc.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ParameterDesc.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ParameterDesc.java 11 Jun 2002 14:53:54 -0000 1.10 +++ ParameterDesc.java 21 Jun 2002 14:48:38 -0000 1.11 @@ -118,8 +118,11 @@ } public String toString() { - return "(" + typeEntry + ", " + getName() + ", " - + (mode == IN ? "IN)" : mode == INOUT ? "INOUT)" : "OUT)" + "position:" + order); + return "name: " + name + + "\ntypeEntry: " + typeEntry + + "\nmode: " + (mode == IN ? "IN" : mode == INOUT ? "INOUT" : "OUT: " + "position:" + order) + + "\ntypeQName: " + typeQName + + "\njavaType: " + javaType; } // toString /** 1.28 +2 -1 xml-axis/java/src/org/apache/axis/description/ServiceDesc.java Index: ServiceDesc.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ServiceDesc.java 14 Jun 2002 22:39:50 -0000 1.27 +++ ServiceDesc.java 21 Jun 2002 14:48:38 -0000 1.28 @@ -718,7 +718,6 @@ } else { paramDesc.setName("in" + k); } - paramDesc.setJavaType(type); // If it's a Holder, mark it INOUT and set the type to the // held type. Otherwise it's IN with its own type. @@ -727,9 +726,11 @@ if (heldClass != null) { paramDesc.setMode(ParameterDesc.INOUT); paramDesc.setTypeQName(tm.getTypeQName(heldClass)); + paramDesc.setJavaType(heldClass); } else { paramDesc.setMode(ParameterDesc.IN); paramDesc.setTypeQName(tm.getTypeQName(type)); + paramDesc.setJavaType(type); } operation.addParameter(paramDesc); } 1.106 +5 -0 xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml Index: Wsdl2javaTestSuite.xml =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- Wsdl2javaTestSuite.xml 19 Jun 2002 19:11:50 -0000 1.105 +++ Wsdl2javaTestSuite.xml 21 Jun 2002 14:48:38 -0000 1.106 @@ -181,6 +181,11 @@ <include name="InvalidCompanyId.java"/> </fileset> </copy> + <copy todir="${build.dir}/work/test/wsdl/roundtrip/holders" overwrite="yes"> + <fileset dir="${test.dir}/wsdl/roundtrip/holders"> + <include name="BondInvestmentHolder.java"/> + </fileset> + </copy> <!-- Compile the Web Service --> <javac srcdir="${build.dir}/work" destdir="${build.dest}" debug="${debug}"> <classpath refid="test-classpath" /> 1.8 +5 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java Index: RoundtripPortType.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- RoundtripPortType.java 21 Jun 2002 13:00:30 -0000 1.7 +++ RoundtripPortType.java 21 Jun 2002 14:48:38 -0000 1.8 @@ -64,6 +64,10 @@ import test.wsdl.roundtrip.InvalidTradeExchange; import test.wsdl.roundtrip.InvalidCompanyId; +import test.wsdl.roundtrip.holders.BondInvestmentHolder; + +import javax.xml.rpc.holders.StringHolder; + /** * The RoundtripPortType interface defines the methods necessary when * when implementing this interface. @@ -170,5 +174,6 @@ public int getId(BondInvestment investment) throws java.rmi.RemoteException; public int getId(Investment investment) throws java.rmi.RemoteException; + public void holderTest(StringHolder sh, BondInvestmentHolder bih); } // RoundtripPortType 1.14 +19 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java Index: RoundtripTestServiceTestCase.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- RoundtripTestServiceTestCase.java 21 Jun 2002 13:00:30 -0000 1.13 +++ RoundtripTestServiceTestCase.java 21 Jun 2002 14:48:38 -0000 1.14 @@ -69,6 +69,8 @@ import javax.xml.rpc.ServiceException; +import javax.xml.rpc.holders.StringHolder; + import test.wsdl.roundtrip.Investment; import test.wsdl.roundtrip.BondInvestment; import test.wsdl.roundtrip.StockInvestment; @@ -80,6 +82,8 @@ import test.wsdl.roundtrip.InvalidTradeExchange; import test.wsdl.roundtrip.InvalidCompanyId; +import test.wsdl.roundtrip.holders.BondInvestmentHolder; + /** * This class contains the test methods to verify that Java mapping * to XML/WSDL works as specified by the JAX-RPC specification. @@ -1217,6 +1221,21 @@ } } // testInvalidTradeExchange + + /** + * Make sure holder inout parameters can be round tripped. + */ + public void testHolderTest() { + try { + StringHolder sh = new StringHolder("hi there"); + BondInvestment bi = new BondInvestment(); + BondInvestmentHolder bih = new BondInvestmentHolder(bi); + binding.holderTest(sh, bih); + } + catch (RemoteException re) { + fail("Remote Exception caught: " + re); + } + } // testHolderTest } // End class RoundtripTestServiceTestCase 1.13 +8 -0 xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java Index: RoundtripTestSoapBindingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- RoundtripTestSoapBindingImpl.java 21 Jun 2002 13:00:30 -0000 1.12 +++ RoundtripTestSoapBindingImpl.java 21 Jun 2002 14:48:38 -0000 1.13 @@ -70,8 +70,12 @@ import test.wsdl.roundtrip.InvalidTradeExchange; import test.wsdl.roundtrip.InvalidCompanyId; +import test.wsdl.roundtrip.holders.BondInvestmentHolder; + import java.rmi.RemoteException; +import javax.xml.rpc.holders.StringHolder; + /** * This class contains the implementations of the methods defined in the * RoundtripPortType interface. Most of the methods compare the actual @@ -685,6 +689,10 @@ public int getId(Investment investment) throws java.rmi.RemoteException { return investment.getId(); + } + + // This is a compile-time test, so we don't need any runtime test code. + public void holderTest(StringHolder sh, BondInvestmentHolder bih) { } } // End class RoundtripTypesTestSoapBindingImpl 1.1 xml-axis/java/test/wsdl/roundtrip/holders/BondInvestmentHolder.java Index: BondInvestmentHolder.java =================================================================== /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Axis" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package test.wsdl.roundtrip.holders; import javax.xml.rpc.holders.Holder; import test.wsdl.roundtrip.BondInvestment; public final class BondInvestmentHolder implements Holder { /** Field _value */ public BondInvestment value; /** * Constructor BondInvestmentHolder */ public BondInvestmentHolder() {} /** * Constructor BondInvestmentHolder * * @param value */ public BondInvestmentHolder(BondInvestment value) { this.value = value; } }