You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2005/01/10 20:02:31 UTC

cvs commit: ws-axis/java/src/org/apache/axis/wsdl/fromJava Types.java

gdaniels    2005/01/10 11:02:31

  Modified:    java/src/org/apache/axis AxisEngine.java
               java/src/org/apache/axis/description JavaServiceDesc.java
               java/src/org/apache/axis/encoding
                        DefaultTypeMappingImpl.java
               java/src/org/apache/axis/wsdl/fromJava Types.java
  Log:
  * Move jaxrpc 1.1 compatibility mode switch to a publically-accessible static variable on AxisEngine.   Might eventually want to move this to AxisProperties.
  
  * When generating type names for arrays, use "MyArrayOf" instead of "ArrayOf" when in JAXRPC mode to avoid stupid WS-I rule
  
  Revision  Changes    Path
  1.117     +15 -0     ws-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- AxisEngine.java	17 Dec 2004 17:00:46 -0000	1.116
  +++ AxisEngine.java	10 Jan 2005 19:02:30 -0000	1.117
  @@ -80,6 +80,8 @@
        * types for a (soap encoded!) array.
        */
       public static final String PROP_DOTNET_SOAPENC_FIX = "dotNetSoapEncFix";
  +    /** Compliance with WS-I Basic Profile. */
  +    public static final String PROP_BP10_COMPLIANCE = "ws-i.bp10Compliance";
   
       public static final String DEFAULT_ATTACHMENT_IMPL="org.apache.axis.attachments.AttachmentsImpl";
   
  @@ -117,6 +119,19 @@
        * What actor URIs hold for the entire engine? Find them here.
        */
       private ArrayList actorURIs = new ArrayList();
  +
  +    /** Are we in JAX-RPC 1.1 compatibility mode? */
  +    public static boolean jaxrpc11Compliance = false;
  +    static {
  +        try {
  +            // We check a system property, but we can use use switches
  +            // to control this in WSDL2Java and at runtime.
  +            jaxrpc11Compliance =
  +                    System.getProperty("axis.jaxrpc11Compliance", "false")
  +                    .equalsIgnoreCase("true");
  +        } catch (Throwable t) {
  +        }
  +    }
   
       /**
        * Thread local storage used for locating the active message context.
  
  
  
  1.18      +10 -0     ws-axis/java/src/org/apache/axis/description/JavaServiceDesc.java
  
  Index: JavaServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/description/JavaServiceDesc.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JavaServiceDesc.java	5 Jan 2005 06:15:13 -0000	1.17
  +++ JavaServiceDesc.java	10 Jan 2005 19:02:30 -0000	1.18
  @@ -1105,6 +1105,16 @@
           completedNames.add(methodName);
       }
   
  +    private String getUniqueOperationName(String name) {
  +        int i = 1;
  +        String candidate;
  +        do {
  +            candidate = name + i++;
  +        } while (name2OperationsMap.get(candidate) != null);
  +
  +        return candidate;
  +    }
  +
       /**
        * Look for methods matching this name, and for each one, create an
        * OperationDesc (if it's not already in our list).
  
  
  
  1.84      +3 -13     ws-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java
  
  Index: DefaultTypeMappingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- DefaultTypeMappingImpl.java	14 Dec 2004 20:22:27 -0000	1.83
  +++ DefaultTypeMappingImpl.java	10 Jan 2005 19:02:30 -0000	1.84
  @@ -17,6 +17,7 @@
   package org.apache.axis.encoding;
   
   import org.apache.axis.Constants;
  +import org.apache.axis.AxisEngine;
   import org.apache.axis.attachments.OctetStream;
   import org.apache.axis.encoding.ser.ArrayDeserializerFactory;
   import org.apache.axis.encoding.ser.ArraySerializerFactory;
  @@ -75,18 +76,6 @@
   public class DefaultTypeMappingImpl extends TypeMappingImpl {
   
       private static DefaultTypeMappingImpl tm = null;
  -    private static boolean jaxrpc11Compliance = false;
  -    
  -    static {
  -        try {
  -            // We check a system property, but we can use use switches
  -            // to control this in WSDL2Java and at runtime.
  -            jaxrpc11Compliance =
  -                    System.getProperty("axis.jaxrpc11Compliance", "false")
  -                    .equalsIgnoreCase("true");
  -        } catch (Throwable t) {
  -        }
  -    }
   
       /**
        * Obtain the singleton default typemapping.
  @@ -563,7 +552,7 @@
                                                Constants.XSD_SCHEMA)
           );
           
  -        if (jaxrpc11Compliance) {
  +        if (AxisEngine.jaxrpc11Compliance) {
               // Table 4-1 of the JAXRPC 1.1 spec
               myRegisterSimple(Constants.XSD_UNSIGNEDINT, long.class);    
               myRegisterSimple(Constants.XSD_UNSIGNEDSHORT, int.class);    
  @@ -608,6 +597,7 @@
               myRegisterSimple(Constants.XSD_ID, java.lang.String.class);
               myRegisterSimple(Constants.XSD_NMTOKEN, java.lang.String.class);
               myRegisterSimple(Constants.XSD_NMTOKENS, java.lang.String.class);
  +            myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
               myRegisterSimple(Constants.XSD_NONPOSITIVEINTEGER, java.math.BigInteger.class);
               myRegisterSimple(Constants.XSD_NEGATIVEINTEGER, java.math.BigInteger.class);
               myRegisterSimple(Constants.XSD_NONNEGATIVEINTEGER, java.math.BigInteger.class);
  
  
  
  1.106     +6 -6      ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- Types.java	16 Dec 2004 18:54:58 -0000	1.105
  +++ Types.java	10 Jan 2005 19:02:30 -0000	1.106
  @@ -15,10 +15,7 @@
    */
   package org.apache.axis.wsdl.fromJava;
   
  -import org.apache.axis.AxisFault;
  -import org.apache.axis.Constants;
  -import org.apache.axis.InternalException;
  -import org.apache.axis.MessageContext;
  +import org.apache.axis.*;
   import org.apache.axis.soap.SOAPConstants;
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.description.ServiceDesc;
  @@ -119,6 +116,9 @@
       /** Which types have we already written? */
       Class [] mappedTypes = null;
   
  +    /** For WS-I BP compliance, we can't use "ArrayOf" as a type prefix - instead use "MyArrayOf" (gag) */
  +    private String arrayTypePrefix = AxisEngine.jaxrpc11Compliance ? "MyArrayOf" : "ArrayOf";
  +
       public static boolean isArray(Class clazz)
       {
           return clazz.isArray() || java.util.Collection.class.isAssignableFrom(clazz);
  @@ -727,13 +727,13 @@
   
               if (targetNamespace.equals(cqName.getNamespaceURI())) {
                   qName = new QName(targetNamespace,
  -                        "ArrayOf" + cqName.getLocalPart());
  +                        arrayTypePrefix + cqName.getLocalPart());
               } else {
                   String pre =
                           namespaces.getCreatePrefix(cqName.getNamespaceURI());
   
                   qName = new QName(targetNamespace,
  -                        "ArrayOf_" + pre + "_"
  +                        arrayTypePrefix + "_" + pre + "_"
                           + cqName.getLocalPart());
               }