ws-axis-cvs 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/toJava JavaEnumTypeWriter.java
Date Sat, 27 Mar 2004 18:23:26 GMT
dims        2004/03/27 10:23:26

  Modified:    java/test/wsdl/datatypes build.xml DataTypes.wsdl
                        DataTypes_BindingImpl.java DataTypesTestCase.java
               java/src/org/apache/axis/wsdl/toJava JavaEnumTypeWriter.java
  Log:
  Fix and test case for AXIS-1157 - QName constants constructed without Schema-specified namespace
  
  Revision  Changes    Path
  1.9       +1 -1      ws-axis/java/test/wsdl/datatypes/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/datatypes/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.xml	21 Feb 2004 19:21:54 -0000	1.8
  +++ build.xml	27 Mar 2004 18:23:26 -0000	1.9
  @@ -58,7 +58,7 @@
                  deployscope="session"
                  serverSide="yes"
                  skeletonDeploy="yes"
  -               testcase="yes">
  +               testcase="no">
           <mapping namespace="urn:dataTypes" package="test.wsdl.datatypes"/>
       </wsdl2java>
   
  
  
  
  1.3       +40 -0     ws-axis/java/test/wsdl/datatypes/DataTypes.wsdl
  
  Index: DataTypes.wsdl
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/datatypes/DataTypes.wsdl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DataTypes.wsdl	19 Dec 2003 15:08:37 -0000	1.2
  +++ DataTypes.wsdl	27 Mar 2004 18:23:26 -0000	1.3
  @@ -6,6 +6,7 @@
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
                xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
                xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
  +             xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
                targetNamespace="urn:dataTypes" 
                xmlns="http://schemas.xmlsoap.org/wsdl/">
     <types>
  @@ -65,6 +66,25 @@
             <s:enumeration value="Off" />
           </s:restriction>
         </s:simpleType>
  +      <s:element name="GetUsageType">
  +        <s:complexType />
  +      </s:element>
  +      <s:element name="GetUsageTypeResponse">
  +        <s:complexType>
  +          <s:sequence>
  +            <s:element minOccurs="1" maxOccurs="1" name="GetUsageTypeResult" type="s0:UsageType"
/>
  +          </s:sequence>
  +        </s:complexType>
  +      </s:element>
  +      <s:simpleType name="UsageType">
  +		<s:restriction base="s:QName">
  +			<s:enumeration value="wsp:Required"/>
  +			<s:enumeration value="wsp:Optional"/>
  +			<s:enumeration value="wsp:Rejected"/>
  +			<s:enumeration value="wsp:Ignored"/>
  +			<s:enumeration value="wsp:Observed"/>
  +		</s:restriction>
  +      </s:simpleType>
         <s:element name="GetOrder">
           <s:complexType />
         </s:element>
  @@ -99,6 +119,7 @@
         <s:element name="string" nillable="true" type="s:string" />
         <s:element name="ArrayOfInt" nillable="true" type="s0:ArrayOfInt" />
         <s:element name="Mode" type="s0:Mode" />
  +      <s:element name="UsageType" type="s0:UsageType" />
         <s:element name="Order" nillable="true" type="s0:Order" />
         <s:element name="ArrayOfOrder" nillable="true" type="s0:ArrayOfOrder" />
         <s:element name="GetSimpleList">
  @@ -144,6 +165,12 @@
     <message name="GetModeSoapOut">
       <part name="parameters" element="s0:GetModeResponse" />
     </message>
  +  <message name="GetUsageTypeSoapIn">
  +    <part name="parameters" element="s0:GetUsageType" />
  +  </message>
  +  <message name="GetUsageTypeSoapOut">
  +    <part name="parameters" element="s0:GetUsageTypeResponse" />
  +  </message>
     <message name="GetOrderSoapIn">
       <part name="parameters" element="s0:GetOrder" />
     </message>
  @@ -179,6 +206,10 @@
         <input message="s0:GetModeSoapIn" />
         <output message="s0:GetModeSoapOut" />
       </operation>
  +    <operation name="GetUsageType">
  +      <input message="s0:GetUsageTypeSoapIn" />
  +      <output message="s0:GetUsageTypeSoapOut" />
  +    </operation>
       <operation name="GetOrder">
         <input message="s0:GetOrderSoapIn" />
         <output message="s0:GetOrderSoapOut" />
  @@ -222,6 +253,15 @@
         </output>
       </operation>
       <operation name="GetMode">
  +      <soap:operation soapAction="" style="document" />
  +      <input>
  +        <soap:body use="literal" />
  +      </input>
  +      <output>
  +        <soap:body use="literal" />
  +      </output>
  +    </operation>
  +    <operation name="GetUsageType">
         <soap:operation soapAction="" style="document" />
         <input>
           <soap:body use="literal" />
  
  
  
  1.4       +4 -0      ws-axis/java/test/wsdl/datatypes/DataTypes_BindingImpl.java
  
  Index: DataTypes_BindingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/datatypes/DataTypes_BindingImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DataTypes_BindingImpl.java	19 Dec 2003 15:09:06 -0000	1.3
  +++ DataTypes_BindingImpl.java	27 Mar 2004 18:23:26 -0000	1.4
  @@ -66,4 +66,8 @@
   
           return outputList;
       }
  +
  +    public test.wsdl.datatypes.UsageType getUsageType() throws java.rmi.RemoteException
{ 
  +	return new test.wsdl.datatypes.UsageType(test.wsdl.datatypes.UsageType._value1);
  +    }
   }
  
  
  
  1.6       +22 -0     ws-axis/java/test/wsdl/datatypes/DataTypesTestCase.java
  
  Index: DataTypesTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/datatypes/DataTypesTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DataTypesTestCase.java	19 Dec 2003 15:09:45 -0000	1.5
  +++ DataTypesTestCase.java	27 Mar 2004 18:23:26 -0000	1.6
  @@ -7,6 +7,8 @@
   
   package test.wsdl.datatypes;
   
  +import javax.xml.namespace.QName;
  +
   public class DataTypesTestCase extends junit.framework.TestCase {
       public DataTypesTestCase(String name) {
           super(name);
  @@ -173,6 +175,26 @@
           catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception caught: "
+ re);
           }
  +    }
  +
  +    public void test5DataTypesGetUsageType() throws Exception {
  +        DataTypes_Port binding;
  +        try {
  +            binding = new DataTypes_ServiceLocator().getDataTypes();
  +        }
  +        catch (javax.xml.rpc.ServiceException jre) {
  +            if(jre.getLinkedCause()!=null)
  +                jre.getLinkedCause().printStackTrace();
  +            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught:
" + jre);
  +        }
  +        assertNotNull("binding is null", binding);
  +
  +        // Test operation
  +        UsageType value = null;
  +        value = binding.getUsageType();
  +        System.out.println(value);
  +        assertEquals(value.getValue(), new QName("http://schemas.xmlsoap.org/ws/2002/12/policy","Required"));
  +        // TBD - validate results
       }
   }
   
  
  
  
  1.28      +11 -0     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java
  
  Index: JavaEnumTypeWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JavaEnumTypeWriter.java	25 Feb 2004 14:02:52 -0000	1.27
  +++ JavaEnumTypeWriter.java	27 Mar 2004 18:23:26 -0000	1.28
  @@ -116,6 +116,9 @@
                                   "l")) {    // doesn't complain about precision.
                       value += "L";
                   }
  +            } else if (baseClass.equals("javax.xml.namespace.QName")) {
  +                value = org.apache.axis.wsdl.symbolTable.Utils.getQNameFromPrefixedName(type.getNode(),
value).toString();
  +                value = "javax.xml.namespace.QName.valueOf(\"" + value + "\")";
               } else if (baseClass.equals(baseType)) {
   
                   // Construct baseClass object with literal string
  @@ -194,6 +197,14 @@
   
           if (baseClass.equals("java.lang.String")) {
               pw.println("        return fromValue(value);");
  +        } else if (baseClass.equals("javax.xml.namespace.QName")) {
  +            pw.println("        try {");
  +            pw.println("            return fromValue(javax.xml.namespace.QName.valueOf"
  +                    + "(value));");
  +            pw.println("        } catch (Exception e) {");
  +            pw.println(
  +                    "            throw new java.lang.IllegalArgumentException();");
  +            pw.println("        }");
           } else if (baseClass.equals(baseType)) {
               pw.println("        try {");
               pw.println("            return fromValue(new " + baseClass
  
  
  

Mime
View raw message