Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 29939 invoked from network); 25 Apr 2005 06:28:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2005 06:28:57 -0000 Received: (qmail 50677 invoked by uid 500); 25 Apr 2005 06:29:17 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 50616 invoked by uid 500); 25 Apr 2005 06:29:17 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 50600 invoked by uid 99); 25 Apr 2005 06:29:17 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from smtp109.mail.sc5.yahoo.com (HELO smtp109.mail.sc5.yahoo.com) (66.163.170.7) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 24 Apr 2005 23:29:16 -0700 Received: from unknown (HELO ?192.168.1.5?) (david?jencks@66.93.38.137 with plain) by smtp109.mail.sc5.yahoo.com with SMTP; 25 Apr 2005 06:28:46 -0000 Mime-Version: 1.0 (Apple Message framework v619.2) In-Reply-To: <20050425000424.59942.qmail@minotaur.apache.org> References: <20050425000424.59942.qmail@minotaur.apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: David Jencks 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: Sun, 24 Apr 2005 23:28:44 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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()); > > >