axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java TypeEntry.java Utils.java
Date Mon, 17 Nov 2003 15:14:04 GMT
dims        2003/11/17 07:14:03

  Modified:    java/test/wsdl/types ComprehensiveTypes.wsdl
                        VerifyTestCase.java
               java/test/wsdl/dataset DataServiceTestCase.java
               java/src/org/apache/axis/wsdl/toJava
                        JavaBeanHelperWriter.java JavaBeanWriter.java
                        JavaDeployWriter.java JavaSkelWriter.java
                        JavaStubWriter.java Utils.java
               java/test/wsdl/qualify Qualify_BindingImpl.java
                        Qualify_ServiceTestCase.java
               java/test/wsdl/interop4/groupi Round4XSDTestSoapImpl.java
                        Round4XSDTestTestCase.java
               java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
                        TypeEntry.java Utils.java
  Log:
  Fix for Bug 24576 - WSDL2Java gens incorrect classes for nested element definition
  from Ias (iasandcb@apache-korea.org)
  
  Revision  Changes    Path
  1.48      +2 -2      ws-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl
  
  Index: ComprehensiveTypes.wsdl
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ComprehensiveTypes.wsdl	3 Jan 2003 14:23:09 -0000	1.47
  +++ ComprehensiveTypes.wsdl	17 Nov 2003 15:14:02 -0000	1.48
  @@ -388,13 +388,13 @@
   
           <!-- Test for nested defined complexType -->
           <xsd:element name="a" type="xsd:short" />
  -        <xsd:complexType name="b">
  -          <xsd:sequence>
               <xsd:complexType name="a">
                 <xsd:sequence>
                   <xsd:element name="c" type="xsd:int" />
                 </xsd:sequence>
               </xsd:complexType>
  +        <xsd:complexType name="b">
  +          <xsd:sequence>
               <xsd:element name="d" type="typens2:a" />
             </xsd:sequence>
           </xsd:complexType>
  
  
  
  1.38      +2 -2      ws-axis/java/test/wsdl/types/VerifyTestCase.java
  
  Index: VerifyTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/types/VerifyTestCase.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- VerifyTestCase.java	1 Mar 2003 01:31:03 -0000	1.37
  +++ VerifyTestCase.java	17 Nov 2003 15:14:02 -0000	1.38
  @@ -56,7 +56,7 @@
   import test.wsdl.types.comprehensive_types.PersionCat;
   import test.wsdl.types.comprehensive_types.Simple;
   import test.wsdl.types.comprehensive_types.SimpleFwd;
  -import test.wsdl.types.comprehensive_types.ComplexWComplex_stock_quote;
  +import test.wsdl.types.comprehensive_types._complexWComplex_stock_quote;
   import test.wsdl.types.comprehensive_types.StringParameter;
   import test.wsdl.types.comprehensive_types.Time;
   import test.wsdl.types.comprehensive_types.Yarn;
  @@ -446,7 +446,7 @@
           } catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("elemWComplexReturn Exception
caught: " + re );
           }
  -        ComplexWComplex_stock_quote stockQuote = new ComplexWComplex_stock_quote();
  +        _complexWComplex_stock_quote stockQuote = new _complexWComplex_stock_quote();
           Time time = new Time();
           time.setDST(false);
           stockQuote.setTime(time);
  
  
  
  1.6       +1 -1      ws-axis/java/test/wsdl/dataset/DataServiceTestCase.java
  
  Index: DataServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/dataset/DataServiceTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DataServiceTestCase.java	1 Mar 2003 01:31:02 -0000	1.5
  +++ DataServiceTestCase.java	17 Nov 2003 15:14:02 -0000	1.6
  @@ -33,7 +33,7 @@
           
           try {
               // Test operation
  -            test.wsdl.dataset._GetTitleAuthorsResponse_GetTitleAuthorsResult value = null;
  +            test.wsdl.dataset.__GetTitleAuthorsResponse_GetTitleAuthorsResult value = null;
               value = binding.getTitleAuthors();
               assertTrue(value != null);
               // TBD - validate results
  
  
  
  1.44      +4 -4      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java
  
  Index: JavaBeanHelperWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- JavaBeanHelperWriter.java	29 Oct 2003 20:46:25 -0000	1.43
  +++ JavaBeanHelperWriter.java	17 Nov 2003 15:14:02 -0000	1.44
  @@ -312,7 +312,7 @@
                   for (int i = 0; i < attributes.size(); i += 2) {
                       TypeEntry te = (TypeEntry) attributes.get(i);
                       QName attrName = (QName) attributes.get(i + 1);
  -                    String attrLocalName = attrName.getLocalPart();
  +                    String attrLocalName = Utils.getLastLocalPart(attrName.getLocalPart());
                       String fieldName =
                               Utils.xmlNameToJava(attrLocalName);
   
  @@ -333,7 +333,7 @@
                       pw.println("        attrField.setFieldName(\"" + fieldName
                               + "\");");
                       pw.println("        attrField.setXmlName("
  -                            + Utils.getNewQName(attrName) + ");");
  +                            + Utils.getNewQNameWithLastLocalPart(attrName) + ");");
   
                       if (attrXmlType != null) {
                           pw.println("        attrField.setXmlType("
  @@ -355,7 +355,7 @@
                           continue;
                       }
   
  -                    String elemLocalName = elem.getName().getLocalPart();
  +                    String elemLocalName = Utils.getLastLocalPart(elem.getName().getLocalPart());
                       String fieldName = Utils.xmlNameToJava(elemLocalName);
   
                       fieldName = getAsFieldName(fieldName);
  @@ -397,7 +397,7 @@
                       pw.println("        elemField.setFieldName(\"" + fieldName
                               + "\");");
                       pw.println("        elemField.setXmlName("
  -                            + Utils.getNewQName(xmlName) + ");");
  +                            + Utils.getNewQNameWithLastLocalPart(xmlName) + ");");
   
                       if (xmlType != null) {
                           pw.println("        elemField.setXmlType("
  
  
  
  1.48      +22 -2     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java
  
  Index: JavaBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JavaBeanWriter.java	17 Nov 2003 14:20:57 -0000	1.47
  +++ JavaBeanWriter.java	17 Nov 2003 15:14:03 -0000	1.48
  @@ -268,6 +268,10 @@
                       isAny = true;
                   } else {
                       String elemName = elem.getName().getLocalPart();
  +                    int anonymousDelimitorIndex = elemName.lastIndexOf('>');
  +                    if (anonymousDelimitorIndex > -1) {
  +                        elemName = elemName.substring(anonymousDelimitorIndex + 1);
  +                    }
   
                       variableName = Utils.xmlNameToJava(elemName);
                   }
  @@ -297,8 +301,13 @@
                   TypeEntry attr = (TypeEntry) attributes.get(i);
                   String typeName = attr.getName();
                   QName xmlName = (QName) attributes.get(i + 1);
  +                String attrName = xmlName.getLocalPart();
  +                int anonymousDelimitorIndex = attrName.lastIndexOf('>');
  +                if (anonymousDelimitorIndex > -1) {
  +                    attrName = attrName.substring(anonymousDelimitorIndex + 1);
  +                }
                   String variableName =
  -                        Utils.xmlNameToJava(xmlName.getLocalPart());
  +                        Utils.xmlNameToJava(attrName);
   
                   names.add(typeName);
                   names.add(variableName);
  @@ -490,6 +499,11 @@
                       String name =
                               ((QName) attributes.get(j + 1)).getLocalPart();
   
  +                    int anonymousDelimitorIndex = name.lastIndexOf('>');
  +                    if (anonymousDelimitorIndex > -1) {
  +                        name = name.substring(anonymousDelimitorIndex + 1);
  +                    }
  +
                       paramNames.add(mangle + Utils.xmlNameToJava(name));
                   }
               }
  @@ -503,10 +517,16 @@
                   for (int j = 0; j < elements.size(); j++) {
                       ElementDecl elem = (ElementDecl) elements.get(j);
   
  +                    String name = elem.getName().getLocalPart();
  +                    int anonymousDelimitorIndex = name.lastIndexOf('>');
  +                    if (anonymousDelimitorIndex > -1) {
  +                        name = name.substring(anonymousDelimitorIndex + 1);
  +                    }
  +
                       paramTypes.add(elem.getType().getName());
                       paramNames.add(
                               mangle
  -                            + Utils.xmlNameToJava(elem.getName().getLocalPart()));
  +                            + Utils.xmlNameToJava(name));
                   }
               }
           }
  
  
  
  1.77      +2 -2      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java
  
  Index: JavaDeployWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- JavaDeployWriter.java	29 Oct 2003 20:46:25 -0000	1.76
  +++ JavaDeployWriter.java	17 Nov 2003 15:14:03 -0000	1.77
  @@ -553,7 +553,7 @@
   
           if (returnQName != null) {
               pw.print(" returnQName=\""
  -                    + Utils.genQNameAttributeString(returnQName, "retNS")
  +                    + Utils.genQNameAttributeStringWithLastLocalPart(returnQName, "retNS")
                       + "\"");
           }
   
  @@ -585,7 +585,7 @@
                   pw.print(" name=\"" + param.getName() + "\"");
               } else {
                   pw.print(" qname=\""
  -                        + Utils.genQNameAttributeString(paramQName, "pns")
  +                        + Utils.genQNameAttributeStringWithLastLocalPart(paramQName, "pns")
                           + "\"");
               }
   
  
  
  
  1.57      +2 -2      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java
  
  Index: JavaSkelWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- JavaSkelWriter.java	29 Oct 2003 20:46:26 -0000	1.56
  +++ JavaSkelWriter.java	17 Nov 2003 15:14:03 -0000	1.57
  @@ -253,11 +253,11 @@
                       retName = parameters.returnParam.getQName();
                       retType = Utils.getXSIType(parameters.returnParam);
                   }
  -
  +                
                   String returnStr;
   
                   if (retName != null) {
  -                    returnStr = Utils.getNewQName(retName);
  +                    returnStr = Utils.getNewQNameWithLastLocalPart(retName);
                   } else {
                       returnStr = "null";
                   }
  
  
  
  1.121     +4 -4      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- JavaStubWriter.java	29 Oct 2003 20:46:26 -0000	1.120
  +++ JavaStubWriter.java	17 Nov 2003 15:14:03 -0000	1.121
  @@ -647,7 +647,7 @@
                   }
   
                   // Get the text representing newing a QName for the name and type
  -                String paramNameText = Utils.getNewQName(p.getQName());
  +                String paramNameText = Utils.getNewQNameWithLastLocalPart(p.getQName());
                   String paramTypeText = Utils.getNewQName(paramType);
   
                   // Generate the addParameter call with the
  @@ -693,7 +693,7 @@
   
                   if (returnQName != null) {
                       pw.println("        oper.setReturnQName("
  -                            + Utils.getNewQName(returnQName) + ");");
  +                            + Utils.getNewQNameWithLastLocalPart(returnQName) + ");");
                   }
   
                   if (parameters.returnParam.isOutHeader()) {
  @@ -1194,7 +1194,7 @@
                       }
   
                       String javifiedName = Utils.xmlNameToJava(p.getName());
  -                    String qnameName = Utils.getNewQName(p.getQName());
  +                    String qnameName = Utils.getNewQNameWithLastLocalPart(p.getQName());
   
                       pw.println("            java.util.Map _output;");
                       pw.println(
  @@ -1212,7 +1212,7 @@
                   for (int i = 0; i < parms.list.size(); ++i) {
                       Parameter p = (Parameter) parms.list.get(i);
                       String javifiedName = Utils.xmlNameToJava(p.getName());
  -                    String qnameName = Utils.getNewQName(p.getQName());
  +                    String qnameName = Utils.getNewQNameWithLastLocalPart(p.getQName());
   
                       if (p.getMode() != Parameter.IN) {
                           writeOutputAssign(pw, javifiedName + ".value = ",
  
  
  
  1.79      +5 -0      ws-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- Utils.java	29 Oct 2003 20:46:26 -0000	1.78
  +++ Utils.java	17 Nov 2003 15:14:03 -0000	1.79
  @@ -878,6 +878,11 @@
                   + "\", \"" + qname.getLocalPart() + "\")";
       }
   
  +    public static String getNewQNameWithLastLocalPart(javax.xml.namespace.QName qname)
{
  +        return "new javax.xml.namespace.QName(\"" + qname.getNamespaceURI()
  +                + "\", \"" + getLastLocalPart(qname.getLocalPart()) + "\")";
  +    }
  +
       /**
        * Get the parameter type name.  If this is a MIME type, then
        * figure out the appropriate type from the MIME type, otherwise
  
  
  
  1.8       +2 -2      ws-axis/java/test/wsdl/qualify/Qualify_BindingImpl.java
  
  Index: Qualify_BindingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/qualify/Qualify_BindingImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Qualify_BindingImpl.java	22 Apr 2003 19:37:13 -0000	1.7
  +++ Qualify_BindingImpl.java	17 Nov 2003 15:14:03 -0000	1.8
  @@ -118,7 +118,7 @@
           return "Hello there: " + name;
       }
   
  -    public test.wsdl.qualify._FormOverrideResponse_response formOverride(test.wsdl.qualify._FormOverride_complex
complex) throws java.rmi.RemoteException {
  +    public test.wsdl.qualify.__FormOverrideResponse_response formOverride(test.wsdl.qualify.__FormOverride_complex
complex) throws java.rmi.RemoteException {
           // Validate XML request to make sure elements are properly qualified
           // or not per the WSDL
           MessageContext mc = MessageContext.getCurrentContext();
  @@ -171,7 +171,7 @@
           }        
   
           // Return a response (which the client will validate)
  -        test.wsdl.qualify._FormOverrideResponse_response r = new _FormOverrideResponse_response();
  +        test.wsdl.qualify.__FormOverrideResponse_response r = new __FormOverrideResponse_response();
           r.setName("Tommy");
           return r;
       }
  
  
  
  1.8       +2 -2      ws-axis/java/test/wsdl/qualify/Qualify_ServiceTestCase.java
  
  Index: Qualify_ServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/qualify/Qualify_ServiceTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Qualify_ServiceTestCase.java	22 Apr 2003 19:37:13 -0000	1.7
  +++ Qualify_ServiceTestCase.java	17 Nov 2003 15:14:03 -0000	1.8
  @@ -149,8 +149,8 @@
           assertTrue("binding is null", binding != null);
   
           try {
  -            _FormOverrideResponse_response value = null;
  -            _FormOverride_complex arg = new _FormOverride_complex();
  +            __FormOverrideResponse_response value = null;
  +            __FormOverride_complex arg = new __FormOverride_complex();
               arg.setName("Timmah");
               value = binding.formOverride(arg);
               
  
  
  
  1.6       +2 -2      ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestSoapImpl.java
  
  Index: Round4XSDTestSoapImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestSoapImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Round4XSDTestSoapImpl.java	1 Mar 2003 01:31:03 -0000	1.5
  +++ Round4XSDTestSoapImpl.java	17 Nov 2003 15:14:03 -0000	1.6
  @@ -104,8 +104,8 @@
           return inputAnyType;
       }
   
  -    public test.wsdl.interop4.groupi._echoAnyElementResponse_return echoAnyElement(test.wsdl.interop4.groupi._echoAnyElement_inputAny
inputAny) throws java.rmi.RemoteException {
  -        test.wsdl.interop4.groupi._echoAnyElementResponse_return output = new test.wsdl.interop4.groupi._echoAnyElementResponse_return();
  +    public test.wsdl.interop4.groupi.__echoAnyElementResponse_return echoAnyElement(test.wsdl.interop4.groupi.__echoAnyElement_inputAny
inputAny) throws java.rmi.RemoteException {
  +        test.wsdl.interop4.groupi.__echoAnyElementResponse_return output = new test.wsdl.interop4.groupi.__echoAnyElementResponse_return();
           output.set_any(inputAny.get_any());
           return output;
       }
  
  
  
  1.7       +2 -2      ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestTestCase.java
  
  Index: Round4XSDTestTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/interop4/groupi/Round4XSDTestTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Round4XSDTestTestCase.java	1 Mar 2003 01:31:03 -0000	1.6
  +++ Round4XSDTestTestCase.java	17 Nov 2003 15:14:03 -0000	1.7
  @@ -573,11 +573,11 @@
           assertTrue("binding is null", binding != null);
   
           try {
  -            test.wsdl.interop4.groupi._echoAnyElement_inputAny input = new test.wsdl.interop4.groupi._echoAnyElement_inputAny();
  +            test.wsdl.interop4.groupi.__echoAnyElement_inputAny input = new test.wsdl.interop4.groupi.__echoAnyElement_inputAny();
               org.apache.axis.message.MessageElement [] _any = new org.apache.axis.message.MessageElement
[1];
               _any[0] = new org.apache.axis.message.MessageElement("hello", "world");
               input.set_any(_any);
  -            test.wsdl.interop4.groupi._echoAnyElementResponse_return value = null;
  +            test.wsdl.interop4.groupi.__echoAnyElementResponse_return value = null;
               value = binding.echoAnyElement(input);
               assertEquals(value.get_any()[0].toString(), _any[0].toString());
           }
  
  
  
  1.81      +41 -5     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- SymbolTable.java	4 Nov 2003 13:26:21 -0000	1.80
  +++ SymbolTable.java	17 Nov 2003 15:14:03 -0000	1.81
  @@ -1720,8 +1720,10 @@
           // instead of: void echo(StringHolder inout)
           // Do this:  string echo(string in)
           if (wrapped && (inputs.size() == 1) && (outputs.size() == 1)
  -                && ((Parameter) inputs.get(0)).getName().equals(
  -                        ((Parameter) outputs.get(0)).getName())) {
  +                && 
  +                Utils.getLastLocalPart(((Parameter) inputs.get(0)).getName()).equals(
  +                Utils.getLastLocalPart(((Parameter) outputs.get(0)).getName()))
  +                ) {
   
               // add the input and make sure its a IN not an INOUT
               addInishParm(inputs, null, 0, -1, parameters, false);
  @@ -1792,9 +1794,11 @@
        * @return 
        */
       private int getPartIndex(String name, Vector v) {
  -
  +        name = Utils.getLastLocalPart(name);
           for (int i = 0; i < v.size(); i++) {
  -            if (name.equals(((Parameter) v.get(i)).getName())) {
  +            String paramName = ((Parameter) v.get(i)).getName();
  +            paramName = Utils.getLastLocalPart(paramName);
  +            if (name.equals(paramName)) {
                   return i;
               }
           }
  @@ -1844,13 +1848,45 @@
           if (outdex >= 0) {
               Parameter outParam = (Parameter) outputs.get(outdex);
   
  +            TypeEntry paramEntry = p.getType();
  +            TypeEntry outParamEntry = outParam.getType();
  +            String paramLastLocalPart = Utils.getLastLocalPart(paramEntry.getQName().getLocalPart());
  +            String outParamLastLocalPart = Utils.getLastLocalPart(outParamEntry.getQName().getLocalPart());
               if (p.getType().equals(outParam.getType())) {
                   outputs.remove(outdex);
                   p.setMode(Parameter.INOUT);
   
                   ++parameters.inouts;
  -            } else {
  +            } 
  +            /*
  +            else if (paramLastLocalPart.equals(outParamLastLocalPart)) {
  +                outputs.remove(outdex);
  +                p.setMode(Parameter.INOUT);
   
  +                ++parameters.inouts;
  +                if (paramEntry.isBaseType()) {
  +                    if (paramEntry.getBaseType().equals(outParamEntry.getBaseType())) {
  +                        outputs.remove(outdex);
  +                        p.setMode(Parameter.INOUT);
  +
  +                        ++parameters.inouts;
  +                    }
  +                }
  +                else if (paramEntry.getRefType() != null) {
  +                    if (paramEntry.getRefType().equals(outParamEntry.getRefType())) {
  +                        outputs.remove(outdex);
  +                        p.setMode(Parameter.INOUT);
  +
  +                        ++parameters.inouts;
  +                    }
  +                }
  +                else {
  +                    ++parameters.inputs;
  +                }
  +            }
  +        */
  +            else {
  +                
                   // If we're here, we have both an input and an output
                   // part with the same name but different types.... guess
                   // it's not really an inout....
  
  
  
  1.12      +0 -6      ws-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java
  
  Index: TypeEntry.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TypeEntry.java	29 Oct 2003 20:46:24 -0000	1.11
  +++ TypeEntry.java	17 Nov 2003 15:14:03 -0000	1.12
  @@ -181,8 +181,6 @@
               isBaseType = (refType.isBaseType && refType.dims.equals("")
                       && dims.equals(""));
           }
  -
  -        // System.out.println(toString());
       }
   
       /**
  @@ -200,8 +198,6 @@
           undefined = false;
           dims = "";
           isBaseType = false;
  -
  -        // System.out.println(toString());
       }
   
       /**
  @@ -217,8 +213,6 @@
           undefined = false;
           dims = "";
           isBaseType = true;
  -
  -        // System.out.println(toString());
       }
   
       /**
  
  
  
  1.31      +32 -7     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Utils.java	29 Oct 2003 20:46:24 -0000	1.30
  +++ Utils.java	17 Nov 2003 15:14:03 -0000	1.31
  @@ -298,8 +298,6 @@
           // This routine may be called for complexType elements.  In some cases,
           // the complexType may be anonymous, which is why the getScopedAttribute
           // method is used.
  -        if (localName == null) {
  -            localName = "";
   
               Node search = node.getParentNode();
   
  @@ -312,17 +310,16 @@
                           || kind.getLocalPart().equals("attribute")) {
                       localName = SymbolTable.ANON_TOKEN
                               + getNodeNameQName(search).getLocalPart();
  -                    search = search.getParentNode();
  +                    search = null;
                   } else if (kind.getLocalPart().equals("complexType")
                           || kind.getLocalPart().equals("simpleType")) {
                       localName = getNodeNameQName(search).getLocalPart()
  -                            + localName;
  +                            + SymbolTable.ANON_TOKEN + localName;
                       search = null;
                   } else {
                       search = search.getParentNode();
                   }
               }
  -        }
   
           if (localName == null) {
               return null;
  @@ -414,8 +411,16 @@
                   } else if (!maxOccursValue.equals("1")
                           || !minOccursValue.equals("1")) {
                       String localPart = qName.getLocalPart();
  -
  -                    localPart += "[" + maxOccursValue + "]";
  +                    String range = "[";
  +                    if (!minOccursValue.equals("1")) {
  +                        range += minOccursValue;
  +                    }
  +                    range += ",";
  +                    if (!maxOccursValue.equals("1")) {
  +                        range += maxOccursValue;
  +                    }
  +                    range += "]";
  +                    localPart += range;
                       qName = findQName(qName.getNamespaceURI(), localPart);
                   }
               }
  @@ -799,5 +804,25 @@
   
           return prefix + ":" + qname.getLocalPart() + "\" xmlns:" + prefix
                   + "=\"" + qname.getNamespaceURI();
  +    }
  +    
  +    public static String genQNameAttributeStringWithLastLocalPart(QName qname, String prefix)
{
  +        String lastLocalPart = getLastLocalPart(qname.getLocalPart());
  +        if ((qname.getNamespaceURI() == null)
  +                || qname.getNamespaceURI().equals("")) {
  +            return lastLocalPart;
  +        }
  +
  +        return prefix + ":" + lastLocalPart + "\" xmlns:" + prefix
  +                + "=\"" + qname.getNamespaceURI();
  +    }
  +
  +    public static String getLastLocalPart(String localPart) {
  +        int anonymousDelimitorIndex = localPart.lastIndexOf('>');
  +        if (anonymousDelimitorIndex > -1) {
  +            localPart = localPart.substring(anonymousDelimitorIndex + 1);
  +        }
  +        return localPart;
  +        
       }
   }
  
  
  

Mime
View raw message