Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 59135 invoked from network); 26 Aug 2008 13:24:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Aug 2008 13:24:41 -0000 Received: (qmail 6454 invoked by uid 500); 26 Aug 2008 13:24:37 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 6347 invoked by uid 500); 26 Aug 2008 13:24:37 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 6327 invoked by uid 500); 26 Aug 2008 13:24:37 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 6316 invoked by uid 99); 26 Aug 2008 13:24:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2008 06:24:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2008 13:23:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5322A2388987; Tue, 26 Aug 2008 06:23:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r689069 - in /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2: datasource/jaxb/JAXBCustomBuilder.java jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Date: Tue, 26 Aug 2008 13:23:47 -0000 To: axis2-cvs@ws.apache.org From: scheu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080826132348.5322A2388987@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: scheu Date: Tue Aug 26 06:23:47 2008 New Revision: 689069 URL: http://svn.apache.org/viewvc?rev=689069&view=rev Log: Quick Fix The Doc/Lit Bare marshaller unmarshals raw parameters (not a wrapper bean). Thus it may have to unmarshal generic types (i.e. xml defined with an any) into java.lang.Object parameters. In such cases, it is best to disable the "early unmarshalling". Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBCustomBuilder.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBCustomBuilder.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBCustomBuilder.java?rev=689069&r1=689068&r2=689069&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBCustomBuilder.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBCustomBuilder.java Tue Aug 26 06:23:47 2008 @@ -80,8 +80,14 @@ OMNamespace ns = factory.createOMNamespace(namespace, reader.getPrefix()); Object jaxb = jdsContext.unmarshal(reader); + if (log.isDebugEnabled()) { + log.debug("Successfully unmarshalled jaxb object " + jaxb); + } OMDataSource ds = new JAXBDataSource(jaxb, jdsContext); + if (log.isDebugEnabled()) { + log.debug("The JAXBDataSource is " + ds); + } OMSourcedElement omse = factory.createOMElement(ds, localPart, ns); parent.addChild(omse); Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?rev=689069&r1=689068&r2=689069&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Tue Aug 26 06:23:47 2008 @@ -20,6 +20,7 @@ package org.apache.axis2.jaxws.marshaller.impl.alt; import org.apache.axis2.jaxws.ExceptionFactory; +import org.apache.axis2.jaxws.core.MessageContext; import org.apache.axis2.jaxws.description.AttachmentDescription; import org.apache.axis2.jaxws.description.AttachmentType; import org.apache.axis2.jaxws.description.EndpointDescription; @@ -83,9 +84,11 @@ // Remember this unmarshal information so that we can speed up processing // the next time. - MethodMarshallerUtils.registerUnmarshalInfo(message.getMessageContext(), - packages, - marshalDesc.getPackagesKey()); + if (shouldRegisterUnmarshalInfo(operationDesc, message.getMessageContext())) { + MethodMarshallerUtils.registerUnmarshalInfo(message.getMessageContext(), + packages, + marshalDesc.getPackagesKey()); + } // Get the return value. Class returnType = operationDesc.getResultActualType(); @@ -170,9 +173,11 @@ // Remember this unmarshal information so that we can speed up processing // the next time. - MethodMarshallerUtils.registerUnmarshalInfo(message.getMessageContext(), - packages, - marshalDesc.getPackagesKey()); + if (shouldRegisterUnmarshalInfo(operationDesc, message.getMessageContext())) { + MethodMarshallerUtils.registerUnmarshalInfo(message.getMessageContext(), + packages, + marshalDesc.getPackagesKey()); + } // Unmarshal the ParamValues from the message List pvList = MethodMarshallerUtils.getPDElements(pds, @@ -412,4 +417,33 @@ } } + /** + * Registering UnmarshalInfo will cause JAXB unmarshalling to occur + * during StAXOMBuilder processing the next time an xml message is targered + * at this wsdl operation. In some cases we want to disable this early unmarshalling. + * + * @param OperationDescription + * @param MessageContext + * @return true or false + */ + private static boolean shouldRegisterUnmarshalInfo(OperationDescription opDesc, + MessageContext mc) { + + ParameterDescription[] pds = opDesc.getParameterDescriptions(); + + // If one or more operations have a generic type of Object, then + // avoid early unmarshalling + for (int i=0; i