cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r761790 - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/util/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/fron...
Date Fri, 03 Apr 2009 20:53:51 GMT
Author: dkulp
Date: Fri Apr  3 20:53:51 2009
New Revision: 761790

URL: http://svn.apache.org/viewvc?rev=761790&view=rev
Log:
Merged revisions 761789 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r761789 | dkulp | 2009-04-03 16:50:23 -0400 (Fri, 03 Apr 2009) | 5 lines
  
  [CXF-2148, CXF-2147, CXF-2149, CXF-2152]
  Fix problems of not generating all the required @XmlXXXX annotations on the params for doc/lit/wrapped.
 (patch from Alessio Soldano applied)
  Fix problems with different types spring aop proxies (patch from Gyorgy Orban applied)
  Fix a class cast type thing in the SOAPMessageContext.
........

Added:
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/XmlJavaTypeAdapterAnnotator.java
      - copied unchanged from r761789, cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/XmlJavaTypeAdapterAnnotator.java
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/SpringAopClassHelper.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr  3 20:53:51 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761759
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761759,761789

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/SpringAopClassHelper.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/SpringAopClassHelper.java?rev=761790&r1=761789&r2=761790&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/SpringAopClassHelper.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/SpringAopClassHelper.java
Fri Apr  3 20:53:51 2009
@@ -34,11 +34,14 @@
     protected Class getRealClassInternal(Object o) {
         if (AopUtils.isAopProxy(o)) {
             Advised advised = (Advised)o;
-            if (advised == null) {
-                return AopUtils.getTargetClass(o);
-            }
             try {
-                return getRealClassInternal(advised.getTargetSource().getTarget());
+                Object target = advised.getTargetSource().getTarget();
+                
+                if (target == null) {
+                    return AopUtils.getTargetClass(o);
+                } else {
+                    return getRealClassInternal(target); 
+                }
             } catch (Exception ex) {
                 // ignore
             }

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java?rev=761790&r1=761789&r2=761790&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
Fri Apr  3 20:53:51 2009
@@ -82,7 +82,6 @@
         return message;
     }
 
-    // TODO: handle the boolean parameter
     public Object[] getHeaders(QName name, JAXBContext context, boolean allRoles) {
         SOAPMessage msg = getMessage();
         SOAPHeader header;
@@ -103,7 +102,7 @@
                     
                 }
             }
-            return ret.toArray(new SOAPHeaderElement[ret.size()]);
+            return ret.toArray(new Object[ret.size()]);
         } catch (SOAPException e) {
             throw new WebServiceException(e);
         } catch (JAXBException e) {

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=761790&r1=761789&r2=761790&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Fri Apr  3 20:53:51 2009
@@ -27,6 +27,7 @@
 import java.util.logging.Level;
 
 import javax.wsdl.OperationType;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.i18n.Message;
@@ -43,10 +44,13 @@
 import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebParamAnnotator;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlJavaTypeAdapterAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlListAnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.mapper.ParameterMapper;
+import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeList;
+import org.apache.ws.commons.schema.constants.Constants;
 
 public class ParameterProcessor extends AbstractProcessor {
     public static final String HEADER = "messagepart.isheader";
@@ -131,14 +135,28 @@
         }
         
         if (part != null && part.getXmlSchema() instanceof XmlSchemaSimpleType) {
-            XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)part.getXmlSchema();
-            if (simpleType.getContent() instanceof XmlSchemaSimpleTypeList && !part.isElement())
{
-                method.annotate(new XmlListAnotator(method.getInterface()));
+            processXmlSchemaSimpleType((XmlSchemaSimpleType)part.getXmlSchema(), method,
part);
+        } else if (part != null && part.getXmlSchema() instanceof XmlSchemaElement)
{
+            XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema();
+            if (element.getSchemaType() instanceof XmlSchemaSimpleType) {
+                processXmlSchemaSimpleType((XmlSchemaSimpleType)element.getSchemaType(),
method, part);
             }
         }
         
         method.setReturn(returnType);
     }
+    
+    private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod
method,
+                                                   MessagePartInfo part) {
+        if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList
+            && (!part.isElement() || !method.isWrapperStyle())) {
+            method.annotate(new XmlListAnotator(method.getInterface()));
+        }
+        if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName())
+            && (!part.isElement() || !method.isWrapperStyle())) {
+            method.annotate(new XmlJavaTypeAdapterAnnotator(method.getInterface(), HexBinaryAdapter.class));
+        }
+    }
 
     private boolean isOutOfBandHeader(final MessagePartInfo part) {
         return Boolean.TRUE.equals(part.getProperty(OUT_OF_BAND_HEADER));

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java?rev=761790&r1=761789&r2=761790&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java
Fri Apr  3 20:53:51 2009
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.mapper;
 
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+
 import org.apache.cxf.jaxb.JAXBUtils;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.tools.common.ToolContext;
@@ -26,9 +28,12 @@
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlJavaTypeAdapterAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlListAnotator;
+import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeList;
+import org.apache.ws.commons.schema.constants.Constants;
 
 
 public final class ParameterMapper {
@@ -45,9 +50,11 @@
         JavaParameter parameter = new JavaParameter(name, type, namespace);
         parameter.setPartName(part.getName().getLocalPart());
         if (part.getXmlSchema() instanceof XmlSchemaSimpleType) {
-            XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)part.getXmlSchema();
-            if (simpleType.getContent() instanceof XmlSchemaSimpleTypeList && !part.isElement())
{
-                parameter.annotate(new XmlListAnotator(jm.getInterface()));
+            processXmlSchemaSimpleType((XmlSchemaSimpleType)part.getXmlSchema(), jm, parameter,
part);
+        } else if (part.getXmlSchema() instanceof XmlSchemaElement) {
+            XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema();
+            if (element.getSchemaType() instanceof XmlSchemaSimpleType) {
+                processXmlSchemaSimpleType((XmlSchemaSimpleType)element.getSchemaType(),
jm, parameter, part);
             }
         }
         parameter.setQName(ProcessorUtil.getElementName(part));
@@ -70,5 +77,16 @@
         return parameter;
     }
 
+    private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod
jm,
+                                                   JavaParameter parameter, MessagePartInfo
part) {
+        if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList
+            && (!part.isElement() || !jm.isWrapperStyle())) {
+            parameter.annotate(new XmlListAnotator(jm.getInterface()));
+        }
+        if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName()) 
+            && (!part.isElement() || !jm.isWrapperStyle())) {
+            parameter.annotate(new XmlJavaTypeAdapterAnnotator(jm.getInterface(), HexBinaryAdapter.class));
+        }
+    }
    
 }



Mime
View raw message