cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r467567 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Date Wed, 25 Oct 2006 05:40:26 GMT
Author: ffang
Date: Tue Oct 24 22:40:25 2006
New Revision: 467567

URL: http://svn.apache.org/viewvc?view=rev&rev=467567
Log:
[CXF-157] Runtime error processing anonymous ref in WSDL during Service.create()
[CXF-158] ClassCastException in JaxWsServiceFactoryBean.initalizeClassInfo

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=467567&r1=467566&r2=467567
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Tue Oct 24 22:40:25 2006
@@ -409,7 +409,9 @@
         XmlSchemaComplexType xsct = null;
         if (inputEl.getSchemaType() instanceof XmlSchemaComplexType) {
             xsct = (XmlSchemaComplexType)inputEl.getSchemaType();
-            if (hasAttributes(xsct) || !isWrappableSequence(xsct, unwrappedInput)) {
+            if (hasAttributes(xsct) || !isWrappableSequence(xsct,
+                                                            inputEl.getQName().getNamespaceURI(),
+                                                            unwrappedInput)) {
                 passedRule = false;
             }
         } else {
@@ -425,7 +427,9 @@
 
             if (outputEl != null && outputEl.getSchemaType() instanceof XmlSchemaComplexType)
{
                 xsct = (XmlSchemaComplexType)outputEl.getSchemaType();
-                if (hasAttributes(xsct) || !isWrappableSequence(xsct, unwrappedOutput)) {
+                if (hasAttributes(xsct) || !isWrappableSequence(xsct, 
+                                                                outputEl.getQName().getNamespaceURI(),
+                                                                unwrappedOutput)) {
                     passedRule = false;
                 }
             } else {
@@ -455,7 +459,9 @@
         return false;
     }
 
-    private boolean isWrappableSequence(XmlSchemaComplexType type, MessageInfo wrapper) {
+    private boolean isWrappableSequence(XmlSchemaComplexType type, 
+                                        String namespaceURI, 
+                                        MessageInfo wrapper) { 
         if (type.getParticle() instanceof XmlSchemaSequence) {
             XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
             XmlSchemaObjectCollection items = seq.getItems();
@@ -467,7 +473,12 @@
                 }
                 XmlSchemaElement el = (XmlSchemaElement)o;
 
-                MessagePartInfo mpi = wrapper.addMessagePart(el.getQName());
+                // Handle anonymous ref
+                QName elQname = el.getQName();
+                if (elQname == null) {
+                    elQname = new QName(namespaceURI, el.getRefName().getLocalPart());
+                }
+                MessagePartInfo mpi = wrapper.addMessagePart(elQname); 
                 mpi.setTypeQName(el.getSchemaTypeName());
             }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=467567&r1=467566&r2=467567
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Tue Oct 24 22:40:25 2006
@@ -246,7 +246,8 @@
                 if (((Class) selected.getReturnType()).getName().equals("void")) {
                     // to avoid <element name="..."><complexType/></element>
in
                     // output message part
-                    if (paraType.length > inPartCount + outIdx) {
+                    if (paraType.length > inPartCount + outIdx 
+                            && paraType[inPartCount + outIdx] instanceof ParameterizedType)
{
                         ParameterizedType paramType = (ParameterizedType) paraType[inPartCount
+ outIdx];
                         Class rawClass = getHolderClass(paramType, inPartCount + outIdx);
                         mpiOut.setProperty(Class.class.getName(), rawClass);



Mime
View raw message