geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@apache.org>
Subject Re: svn commit: r164508 - in /geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder: AxisBuilder.java AxisServiceBuilder.java HeavyweightOperationDescBuilder.java HeavyweightTypeInfoBuilder.java
Date Mon, 25 Apr 2005 06:28:44 GMT
Discussions with Dims indicate that the original behavior is probably  
correct.  Waiting for confirmation before reverting.  One way of  
looking at the question is whether objects that are to be sent  
rpc-encoded must be able to be translated into documents that conform  
to the schema supplied in the wsdl.  (since they are sent rpc-encoded,  
such a document would have only a tenuous relationship to any xml used  
to send the message.) (also, such a document could not be translated  
back into an equivalent object: you'd get a tree rather than a graph).  
The original implementation effectively applied the nillable schema  
constraint or lack therof to the java object during serialization.   
This modification effectively treated all elements in a schema used for  
an rpc-encoded service as if they had nillable="true".  There does not  
appear to be any explicit support in the spec for this, but neither  
does there appear to be any clear indication of just what the schema is  
to be used for.  Personally I think that since schemas can specify  
nillable, they should be believed, and the lack of nillable should  
force the corresponding object fields to be non-null.

thanks
david jencks

On Apr 24, 2005, at 5:04 PM, djencks@apache.org wrote:

> Author: djencks
> Date: Sun Apr 24 17:04:22 2005
> New Revision: 164508
>
> URL: http://svn.apache.org/viewcvs?rev=164508&view=rev
> Log:
> With shiny new encoding, ignore those pesky schema constraints
>
> Modified:
>      
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisBuilder.java
>      
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisServiceBuilder.java
>      
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightOperationDescBuilder.java
>      
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightTypeInfoBuilder.java
>
> Modified:  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisBuilder.java
> URL:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/ 
> java/org/apache/geronimo/axis/builder/AxisBuilder.java? 
> rev=164508&r1=164507&r2=164508&view=diff
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisBuilder.java (original)
> +++  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisBuilder.java Sun Apr 24 17:04:22 2005
> @@ -325,6 +325,7 @@
>          int i = 0;
>          Set wrapperElementQNames = new HashSet();
>          JavaXmlTypeMappingType[] javaXmlTypeMappings =  
> mapping.getJavaXmlTypeMappingArray();
> +        boolean hasEncoded = false;
>          for (Iterator ops = operations.iterator(); ops.hasNext();) {
>              Operation operation = (Operation) ops.next();
>              String operationName = operation.getName();
> @@ -347,8 +348,9 @@
>              OperationInfo operationInfo =  
> operationDescBuilder.buildOperationInfo(soapVersion);
>              operationInfos[i++] = operationInfo;
>               
> wrapperElementQNames.addAll(operationDescBuilder.getWrapperElementQName 
> s());
> +            hasEncoded |= operationDescBuilder.isEncoded();
>          }
> -        HeavyweightTypeInfoBuilder builder = new  
> HeavyweightTypeInfoBuilder(classLoader,  
> schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap(),  
> wrapperElementQNames);
> +        HeavyweightTypeInfoBuilder builder = new  
> HeavyweightTypeInfoBuilder(classLoader,  
> schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap(),  
> wrapperElementQNames, hasEncoded);
>          List typeInfo = builder.buildTypeInfo(mapping);
>
>          seiFactory = createSEIFactory(serviceName, portName,  
> enhancedServiceEndpointClass, serviceImpl, typeInfo, location,  
> operationInfos, handlerInfos, credentialsName, context, classLoader);
>
> Modified:  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisServiceBuilder.java
> URL:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/ 
> java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java? 
> rev=164508&r1=164507&r2=164508&view=diff
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisServiceBuilder.java (original)
> +++  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/AxisServiceBuilder.java Sun Apr 24 17:04:22 2005
> @@ -147,7 +147,7 @@
>          } else {
>              serviceDesc.setUse(Use.ENCODED);
>          }
> -
> +        boolean hasEncoded = serviceDesc.getUse() == Use.ENCODED;
>
>          boolean isLightweight =  
> portInfo.getServiceEndpointInterfaceMapping() == null;
>
> @@ -170,11 +170,11 @@
>              LightweightTypeInfoBuilder builder = new  
> LightweightTypeInfoBuilder(classLoader, schemaTypeKeyToSchemaTypeMap,  
> wrapperElementQNames);
>              typeInfo =  
> builder.buildTypeInfo(portInfo.getJavaWsdlMapping());
>          } else {
> -            HeavyweightTypeInfoBuilder builder = new  
> HeavyweightTypeInfoBuilder(classLoader, schemaTypeKeyToSchemaTypeMap,  
> wrapperElementQNames);
> +            HeavyweightTypeInfoBuilder builder = new  
> HeavyweightTypeInfoBuilder(classLoader, schemaTypeKeyToSchemaTypeMap,  
> wrapperElementQNames, hasEncoded);
>              typeInfo =  
> builder.buildTypeInfo(portInfo.getJavaWsdlMapping());
>          }
>          TypeInfo.register(typeInfo, typeMapping);
> -
> +
>          serviceDesc.getOperations();
>          return new ReadOnlyServiceDesc(serviceDesc, typeInfo);
>      }
>
> Modified:  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightOperationDescBuilder.java
> URL:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/ 
> java/org/apache/geronimo/axis/builder/ 
> HeavyweightOperationDescBuilder.java? 
> rev=164508&r1=164507&r2=164508&view=diff
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightOperationDescBuilder.java (original)
> +++  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightOperationDescBuilder.java Sun Apr 24 17:04:22 2005
> @@ -76,6 +76,7 @@
>      private final boolean rpcStyle;
>      private final boolean documentStyle;
>      private final boolean wrappedStyle;
> +    private final boolean isEncoded;
>      private final Map publicTypes = new HashMap();
>      private final Map anonymousTypes = new HashMap();
>
> @@ -127,6 +128,7 @@
>              rpcStyle = false;
>              documentStyle = false;
>          }
> +        isEncoded = Use.getUse(soapBody.getUse()) == Use.ENCODED;
>      }
>
>      public Set getWrapperElementQNames() throws DeploymentException {
> @@ -135,6 +137,10 @@
>          return Collections.unmodifiableSet(wrapperElementQNames);
>      }
>
> +    public boolean isEncoded() {
> +        return isEncoded;
> +    }
> +
>      public OperationInfo buildOperationInfo(SOAPConstants  
> soapVersion) throws DeploymentException {
>          buildOperationDesc();
>
> @@ -633,7 +639,7 @@
>      private QName getPartName(Part part) {
>          return null == part.getElementName()? part.getTypeName() :  
> part.getElementName();
>      }
> -
> +
>      private Part getWrappedPart(Message message) throws  
> DeploymentException {
>          // in case of wrapped element, the message has only one part.
>          Collection parts = message.getParts().values();
>
> Modified:  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightTypeInfoBuilder.java
> URL:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/ 
> java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java? 
> rev=164508&r1=164507&r2=164508&view=diff
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightTypeInfoBuilder.java (original)
> +++  
> geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/ 
> builder/HeavyweightTypeInfoBuilder.java Sun Apr 24 17:04:22 2005
> @@ -50,14 +50,17 @@
>   * @version $Rev:  $ $Date:  $
>   */
>  public class HeavyweightTypeInfoBuilder implements TypeInfoBuilder {
> +    private static final String SOAP_ENCODING_NS =  
> "http://schemas.xmlsoap.org/soap/encoding/";
>      private final ClassLoader cl;
>      private final Map schemaTypeKeyToSchemaTypeMap;
>      private final Set wrapperElementQNames;
> +    private final boolean hasEncoded;
>
> -    public HeavyweightTypeInfoBuilder(ClassLoader cl, Map  
> schemaTypeKeyToSchemaTypeMap, Set wrapperElementQNames) {
> +    public HeavyweightTypeInfoBuilder(ClassLoader cl, Map  
> schemaTypeKeyToSchemaTypeMap, Set wrapperElementQNames, boolean  
> hasEncoded) {
>          this.cl = cl;
>          this.schemaTypeKeyToSchemaTypeMap =  
> schemaTypeKeyToSchemaTypeMap;
>          this.wrapperElementQNames = wrapperElementQNames;
> +        this.hasEncoded = hasEncoded;
>      }
>
>      public List buildTypeInfo(JavaWsdlMappingType mapping) throws  
> DeploymentException {
> @@ -221,7 +224,7 @@
>                  } else if (SchemaParticle.ELEMENT !=  
> particle.getParticleType()) {
>                      throw new DeploymentException(xmlName + " is not  
> an element in schema " + schemaType.getName());
>                  }
> -                elementDesc.setNillable(particle.isNillable());
> +                elementDesc.setNillable(particle.isNillable() ||  
> hasEncoded);
>                  elementDesc.setXmlName(xmlName);
>                  elementDesc.setXmlType(particle.getType().getName());
>
>
>


Mime
View raw message