scheu       2002/06/14 11:48:40

  Modified:    java/docs user-guide.html
               java/src/org/apache/axis/wsdl/toJava JavaHolderWriter.java
                        Utils.java
               java/test/wsdl/inout DetailedInoutTestCase.java
                        InoutSOAPBindingImpl.java
               java/test/wsdl/multiref Main.java MultiRefTestCase.java
                        MultiRefTestSOAPBindingImpl.java
               java/test/wsdl/nested Nested2BindingImpl.java
                        Nested2ServiceTestCase.java
               java/test/wsdl/types VerifyTestCase.java
  Log:
  This is a fix for
  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9871
  
  This fix is necessary for TCK compliance.
  
  The generated Holders are now placed in a holders package
  as dictated by JSR 101 v1.0 chp 4.3.5 paragraph 6.
  
  This required changing the Utils.holders method which
  obtains the name of the holders class and a minor change
  to the JavaHolderWriter class.
  
  Also needed to make changes to the testcases to expect
  holders in a holders package.
  
  Minor change to the user guide as well.
  
  Revision  Changes    Path
  1.61      +5 -3      xml-axis/java/docs/user-guide.html
  
  Index: user-guide.html
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/docs/user-guide.html,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- user-guide.html   26 Apr 2002 17:15:36 -0000      1.60
  +++ user-guide.html   14 Jun 2002 18:48:39 -0000      1.61
  @@ -711,20 +711,22 @@
   is simply a class that contains an instance of its type.  For example,
   the holder for the Phone class would be:</p>
   <pre class="example">
  +package samples.addr.holders;
   public final class PhoneHolder implements javax.xml.rpc.holders.Holder {
  -    public Phone value;
  +    public samples.addr.Phone value;
   
       public PhoneHolder()
       {
       }
   
  -    public PhoneHolder(Phone value) {
  +    public PhoneHolder(samples.addr.Phone value) {
           this.value = value;
       }
   }
   </pre>
   <p>A holder class is <b>only</b> generated for a type if that type is used as
  -an inout or out parameter.</p>
  +an inout or out parameter.  Note that the holder class has the suffix "Holder" 
  +appended to the class name, and it is generated in a sub-package with the 
"holders". </p>
   <p>The holder classes for the primitive types can be found in 
javax.xml.rpc.holders.</p>
   <h4>PortTypes</h4>
   <p>The Service Definition Interface (SDI) is the interface that's derived
  
  
  
  1.10      +1 -2      
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaHolderWriter.java
  
  Index: JavaHolderWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaHolderWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JavaHolderWriter.java     7 Jun 2002 12:45:08 -0000       1.9
  +++ JavaHolderWriter.java     14 Jun 2002 18:48:39 -0000      1.10
  @@ -95,7 +95,7 @@
        * Generate the holder for the given complex type.
        */
       protected void writeFileBody(PrintWriter pw) throws IOException {
  -        String holderType = Utils.getJavaLocalName(type.getName());
  +        String holderType = type.getName();
           pw.println("    public " + holderType + " value;");
           pw.println();
           pw.println("    public " + className + "() {");
  @@ -105,7 +105,6 @@
           pw.println("        this.value = value;");
           pw.println("    }");
           pw.println();
  -        pw.println("    // ?++?");
       } // writeOperation
   
   } // class JavaHolderWriter
  
  
  
  1.38      +23 -3     xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Utils.java        11 Jun 2002 14:54:01 -0000      1.37
  +++ Utils.java        14 Jun 2002 18:48:39 -0000      1.38
  @@ -99,6 +99,7 @@
               // This could be a special QName for a indexed property.
               // If so, change the [] to Array.
               name = JavaUtils.replace(name, "[]", "Array");
  +            name = addPackageName(name, "holders");
               return name + "Holder";
           }
           // String also has a reserved holder
  @@ -153,10 +154,29 @@
           else if (typeValue.equals("javax.xml.namespace.QName")) {
               return "javax.xml.rpc.holders.QNameHolder";
           }
  -        // For everything else simply append Holder
  -        else
  -            return typeValue + "Holder";
  +        // For everything else add "holders" package and append
  +        // holder to the class name.
  +        else {
  +            return addPackageName(typeValue, "holders") + "Holder";
  +        }
       } // holder
  +
  +    /**
  +     * Add package to name
  +     * @param String full name of the class.
  +     * @param String name of the package to append
  +     * @return String name with package name added
  +     */
  +    public static String addPackageName(String className, String newPkg) {
  +        int index = className.lastIndexOf(".");
  +        if (index >= 0) {
  +            return className.substring(0, index)
  +                + "." + newPkg
  +                + className.substring(index);
  +        } else {
  +            return newPkg + "." + className;
  +        }
  +    }
   
       /**
        * Given a fault, return the fully qualified Java class name
  
  
  
  1.7       +2 -0      xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java
  
  Index: DetailedInoutTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DetailedInoutTestCase.java        13 Mar 2002 19:50:59 -0000      1.6
  +++ DetailedInoutTestCase.java        14 Jun 2002 18:48:40 -0000      1.7
  @@ -10,6 +10,8 @@
   
   import javax.xml.rpc.holders.IntHolder;
   import javax.xml.rpc.holders.StringHolder;
  +import test.wsdl.inout.holders.AddressHolder;
  +import test.wsdl.inout.holders.PhoneHolder;
   
   /**
    * This class shows how to use the ServiceClient's ability to
  
  
  
  1.3       +2 -0      xml-axis/java/test/wsdl/inout/InoutSOAPBindingImpl.java
  
  Index: InoutSOAPBindingImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/inout/InoutSOAPBindingImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InoutSOAPBindingImpl.java 23 Feb 2002 00:48:28 -0000      1.2
  +++ InoutSOAPBindingImpl.java 14 Jun 2002 18:48:40 -0000      1.3
  @@ -2,6 +2,8 @@
   
   import javax.xml.rpc.holders.IntHolder;
   import javax.xml.rpc.holders.StringHolder;
  +import test.wsdl.inout.holders.AddressHolder;
  +import test.wsdl.inout.holders.PhoneHolder;
   
   public class InoutSOAPBindingImpl implements Inout
   {
  
  
  
  1.3       +1 -1      xml-axis/java/test/wsdl/multiref/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/multiref/Main.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Main.java 5 Feb 2002 16:22:40 -0000       1.2
  +++ Main.java 14 Jun 2002 18:48:40 -0000      1.3
  @@ -60,7 +60,7 @@
   import org.apache.axis.utils.Options;
   
   import java.net.URL;
  -
  +import test.wsdl.multiref.holders.NodeHolder;
   
   
   /**
  
  
  
  1.3       +2 -0      xml-axis/java/test/wsdl/multiref/MultiRefTestCase.java
  
  Index: MultiRefTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/multiref/MultiRefTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MultiRefTestCase.java     19 Feb 2002 17:38:23 -0000      1.2
  +++ MultiRefTestCase.java     14 Jun 2002 18:48:40 -0000      1.3
  @@ -59,6 +59,8 @@
   import org.apache.axis.AxisFault;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import test.wsdl.multiref.holders.NodeHolder;
  +
   
   /** Test the multiref sample code.
    */
  
  
  
  1.2       +7 -7      
xml-axis/java/test/wsdl/multiref/MultiRefTestSOAPBindingImpl.java
  
  Index: MultiRefTestSOAPBindingImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/test/wsdl/multiref/MultiRefTestSOAPBindingImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiRefTestSOAPBindingImpl.java  4 Jan 2002 19:09:41 -0000       1.1
  +++ MultiRefTestSOAPBindingImpl.java  14 Jun 2002 18:48:40 -0000      1.2
  @@ -70,7 +70,7 @@
        *       / \
        *      1   2
        */
  -    public int testSimpleTree(test.wsdl.multiref.NodeHolder root) throws 
java.rmi.RemoteException {
  +    public int testSimpleTree(test.wsdl.multiref.holders.NodeHolder root) throws 
java.rmi.RemoteException {
           Node t = root.value;    // Root of tree 
           Node l = t.getLeft();    // Left side
           Node r = t.getRight();   // Right side
  @@ -94,7 +94,7 @@
        *       \ /
        *        3
        */
  -    public int testDiamond(test.wsdl.multiref.NodeHolder root) throws 
java.rmi.RemoteException {
  +    public int testDiamond(test.wsdl.multiref.holders.NodeHolder root) throws 
java.rmi.RemoteException {
           Node t = root.value;    // Root of tree 
           Node l = t.getLeft();    // Left side
           Node r = t.getRight();   // Right side
  @@ -116,7 +116,7 @@
        *       / \
        *      1   2   and the children of 1 & 2 are backward references to 0
        */
  -    public int testLoop(test.wsdl.multiref.NodeHolder root) throws 
java.rmi.RemoteException {
  +    public int testLoop(test.wsdl.multiref.holders.NodeHolder root) throws 
java.rmi.RemoteException {
           Node t = root.value;    // Root of tree 
           Node l = t.getLeft();    // Left side
           Node r = t.getRight();   // Right side
  @@ -136,7 +136,7 @@
        *        0
        *        and the children of 0 are backward references to 0
        */
  -    public int testSelfRef(test.wsdl.multiref.NodeHolder root) throws 
java.rmi.RemoteException {
  +    public int testSelfRef(test.wsdl.multiref.holders.NodeHolder root) throws 
java.rmi.RemoteException {
           Node t = root.value;    // Root of tree 
           Node l = t.getLeft();    // Left side
           Node r = t.getRight();   // Right side
  @@ -151,7 +151,7 @@
       /**
        * Tests that both arguments are the same node & the nodes don't have children
        */
  -    public int testSameArgs(test.wsdl.multiref.NodeHolder 
root1,test.wsdl.multiref.NodeHolder root2)
  +    public int testSameArgs(test.wsdl.multiref.holders.NodeHolder 
root1,test.wsdl.multiref.holders.NodeHolder root2)
           throws java.rmi.RemoteException {
           Node t1 = root1.value;    // Root1 of tree 
           Node t2 = root2.value;    // Root2 of tree 
  @@ -171,7 +171,7 @@
        *       \ /
        *        2     where 0 and 1 are the argument nodes.                      
        */
  -    public int testArgsRefSameNode(test.wsdl.multiref.NodeHolder 
root1,test.wsdl.multiref.NodeHolder root2)
  +    public int testArgsRefSameNode(test.wsdl.multiref.holders.NodeHolder 
root1,test.wsdl.multiref.holders.NodeHolder root2)
           throws java.rmi.RemoteException {
           Node t1 = root1.value;    // Root1 of tree 
           Node t2 = root2.value;    // Root2 of tree 
  @@ -191,7 +191,7 @@
       /**
        * Tests for two node arguments that reference each other.
        */
  -    public int testArgsRefEachOther(test.wsdl.multiref.NodeHolder 
root1,test.wsdl.multiref.NodeHolder root2)
  +    public int testArgsRefEachOther(test.wsdl.multiref.holders.NodeHolder 
root1,test.wsdl.multiref.holders.NodeHolder root2)
           throws java.rmi.RemoteException {
           Node t1 = root1.value;    // Root1 of tree 
           Node t2 = root2.value;    // Root2 of tree 
  
  
  
  1.3       +2 -0      xml-axis/java/test/wsdl/nested/Nested2BindingImpl.java
  
  Index: Nested2BindingImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/nested/Nested2BindingImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Nested2BindingImpl.java   11 Mar 2002 13:24:40 -0000      1.2
  +++ Nested2BindingImpl.java   14 Jun 2002 18:48:40 -0000      1.3
  @@ -6,6 +6,8 @@
    */
   
   package test.wsdl.nested;
  +import test.wsdl.nested.holders.PEADDRESSHolder;
  +import test.wsdl.nested.holders.RETURNHolder;
   
   public class Nested2BindingImpl implements test.wsdl.nested.Nested2PortType {
       public void nestedSvc2(java.lang.String cUSTOMERNO, java.lang.String 
pIDISTRCHAN, java.lang.String pIDIVISION, java.lang.String pIPASSBUFFER, 
java.lang.String pISALESORG, PEADDRESSHolder pEADDRESS, RETURNHolder rETURN) throws 
java.rmi.RemoteException {
  
  
  
  1.3       +2 -0      xml-axis/java/test/wsdl/nested/Nested2ServiceTestCase.java
  
  Index: Nested2ServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/nested/Nested2ServiceTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Nested2ServiceTestCase.java       11 Mar 2002 13:24:40 -0000      1.2
  +++ Nested2ServiceTestCase.java       14 Jun 2002 18:48:40 -0000      1.3
  @@ -6,6 +6,8 @@
    */
   
   package test.wsdl.nested;
  +import test.wsdl.nested.holders.PEADDRESSHolder;
  +import test.wsdl.nested.holders.RETURNHolder;
   
   public class Nested2ServiceTestCase extends junit.framework.TestCase {
       public Nested2ServiceTestCase(String name) {
  
  
  
  1.26      +10 -10    xml-axis/java/test/wsdl/types/VerifyTestCase.java
  
  Index: VerifyTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/types/VerifyTestCase.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- VerifyTestCase.java       11 Jun 2002 14:54:04 -0000      1.25
  +++ VerifyTestCase.java       14 Jun 2002 18:48:40 -0000      1.26
  @@ -35,26 +35,26 @@
   import javax.xml.namespace.QName;
   
   import test.wsdl.types.comprehensive_types.Animal;
  -import test.wsdl.types.comprehensive_types.AnimalHolder;
  -import test.wsdl.types.comprehensive_types.ArrayHolder;
  -import test.wsdl.types.comprehensive_types.ArrayMHolder;
  +import test.wsdl.types.comprehensive_types.holders.AnimalHolder;
  +import test.wsdl.types.comprehensive_types.holders.ArrayHolder;
  +import test.wsdl.types.comprehensive_types.holders.ArrayMHolder;
   import test.wsdl.types.comprehensive_types.Cat;
  -import test.wsdl.types.comprehensive_types.CatHolder;
  +import test.wsdl.types.comprehensive_types.holders.CatHolder;
   import test.wsdl.types.comprehensive_types.PersionCat;
   import test.wsdl.types.comprehensive_types.Yarn;
   import test.wsdl.types.comprehensive_types.ComplexAll;
  -import test.wsdl.types.comprehensive_types.ComplexAllHolder;
  +import test.wsdl.types.comprehensive_types.holders.ComplexAllHolder;
   import test.wsdl.types.comprehensive_types.ComplexSequence;
  -import test.wsdl.types.comprehensive_types.ComplexSequenceHolder;
  +import test.wsdl.types.comprehensive_types.holders.ComplexSequenceHolder;
   import test.wsdl.types.comprehensive_types.ComplexWComplex;
  -import test.wsdl.types.comprehensive_types.ComplexWComplexHolder;
  +import test.wsdl.types.comprehensive_types.holders.ComplexWComplexHolder;
   import test.wsdl.types.comprehensive_types.ElemWComplex;
  -import test.wsdl.types.comprehensive_types.ElemWComplexHolder;
  +import test.wsdl.types.comprehensive_types.holders.ElemWComplexHolder;
   import test.wsdl.types.comprehensive_types.EmptyComplexType;
  -import test.wsdl.types.comprehensive_types.EmptyComplexTypeHolder;
  +import test.wsdl.types.comprehensive_types.holders.EmptyComplexTypeHolder;
   import test.wsdl.types.comprehensive_types.EmptyFault;
   import test.wsdl.types.comprehensive_types.Enum;
  -import test.wsdl.types.comprehensive_types.EnumHolder;
  +import test.wsdl.types.comprehensive_types.holders.EnumHolder;
   import test.wsdl.types.comprehensive_types.EnumByte;
   import test.wsdl.types.comprehensive_types.EnumDouble;
   import test.wsdl.types.comprehensive_types.EnumFloat;
  
  
  


Reply via email to