cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Ramnarine (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-157) Runtime error processing anonymous ref in WSDL during Service.create()
Date Wed, 18 Oct 2006 21:31:36 GMT
    [ http://issues.apache.org/jira/browse/CXF-157?page=comments#action_12443367 ] 
            
Mike Ramnarine commented on CXF-157:
------------------------------------

Here is a suggested patch to fix this problem in WSDLServiceBuilder.java, as of 18-Oct-2006:

Index: rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java

===================================================================

--- rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java	(revision 465360)

+++ rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java	(working copy)

@@ -404,7 +404,8 @@

         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 {
@@ -420,7 +421,8 @@

 
             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 {
@@ -450,7 +452,7 @@

         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();
@@ -462,7 +464,13 @@

                 }
                 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());
             }
 




> Runtime error processing anonymous ref in WSDL during Service.create()
> ----------------------------------------------------------------------
>
>                 Key: CXF-157
>                 URL: http://issues.apache.org/jira/browse/CXF-157
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Mike Ramnarine
>
> java.lang.IllegalArgumentException: Invalid name [null]
>         at org.apache.cxf.service.model.AbstractMessageContainer.addMessagePart(AbstractMessageContainer.java:69)
>         at org.apache.cxf.wsdl11.WSDLServiceBuilder.isWrappableSequence(WSDLServiceBuilder.java:472)
>         at org.apache.cxf.wsdl11.WSDLServiceBuilder.checkForWrapped(WSDLServiceBuilder.java:407)
>         at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation(WSDLServiceBuilder.java:332)
>         at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface(WSDLServiceBuilder.java:304)
>         at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildService(WSDLServiceBuilder.java:135)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:71)
>         at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:83)
>         at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:48)
>         at javax.xml.ws.Service.<init>(Service.java:57)
>         at javax.xml.ws.Service.create(Service.java:302)
>         ...
> This exception occurs when processing the WSDL following complex type for the queryEndpoints
element of the Artix Locator:
>     <xs:complexType>
>         <xs:sequence>
>             <xs:element ref="query:select"/>
>         </xs:sequence>
>     </xs:complexType>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message