Bug 779975 (SOA-2335) - WSDL parsing error using CXF
Summary: WSDL parsing error using CXF
Keywords:
Status: CLOSED NOTABUG
Alias: SOA-2335
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBossWS
Version: 5.1.0.ER1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 5.1.0 GA
Assignee: Darran Lofthouse
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-22 04:42 UTC by Kevin Conner
Modified: 2011-04-07 14:57 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-19 12:58:07 UTC
Type: Bug


Attachments (Terms of Use)
juddiv3.war.orig (71.98 KB, application/octet-stream)
2010-09-22 04:44 UTC, Kevin Conner
no flags Details
juddiv3.war.new (71.96 KB, application/octet-stream)
2010-09-22 04:44 UTC, Kevin Conner
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPAPP-6270 0 Minor Closed WSDL parsing error using CXF 2015-12-11 16:30:09 UTC
Red Hat Issue Tracker SOA-2335 0 Critical Closed WSDL parsing error using CXF 2015-12-11 16:30:09 UTC

Description Kevin Conner 2010-09-22 04:42:55 UTC
project_key: SOA

The juddi WSDL fails parsing under CXF because of the definition of the input message for the get_changeRecords within the esb_replication_service.wsdl.

The message is defined as follows (within uddi_v3replication.xsd)

        <element name="get_changeRecords">
                <complexType>
                        <sequence>
                                <element name="requestingNode" type="uddi_repl:operatorNodeID_type"/>
                                <element name="changesAlreadySeen" type="uddi_repl:highWaterMarkVector_type" minOccurs="0"/>
                                <choice minOccurs="0">
                                        <element name="responseLimitCount" type="integer"/>
                                        <element name="responseLimitVector" type="uddi_repl:highWaterMarkVector_type"/>
                                </choice>
                        </sequence>
                </complexType>
        </element>

This leads to the following exception, triggered by accessing the wsdl.

java.lang.NullPointerException
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeClassInfo(ReflectionServiceFactoryBean.java:754)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:222)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:674)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:258)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:424)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
	at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:105)
	at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)

The CXF code expects the operation to be wrapped however its verification does not agree.  The deployment executes the following within initializeClassInfo

            if (o.getUnwrappedOperation() == null) {
                //the "normal" algorithm didn't allow for unwrapping,
                //but the annotations say unwrap this.   We'll need to
                //make it.
                WSDLServiceBuilder.checkForWrapped(o, true);
            }

However the invocation of WSDLServiceBuilder.checkForWrapped does not populate the unwrapped operation, leading to the NPE when it is later referenced.

WSDLServiceBuilder.checkForWrapped fails to populate the operation information because the isWrappableSequence method expects everything within the type to be an element, and it does not support the 'choice' element.

Changing the element definition to the following allows it to parse successfully, however it is not equivalent.

        <element name="get_changeRecords">
                <complexType>
                        <sequence>
                                <element name="requestingNode" type="uddi_repl:operatorNodeID_type"/>
                                <element name="changesAlreadySeen" type="uddi_repl:highWaterMarkVector_type" minOccurs="0"/>
                                <element name="responseLimitCount" type="integer" minOccurs="0"/>
                                <element name="responseLimitVector" type="uddi_repl:highWaterMarkVector_type" minOccurs="0"/>
                        </sequence>
                </complexType>
        </element>

Comment 1 Kevin Conner 2010-09-22 04:44:50 UTC
War files containing original schema and modified schema.

Comment 2 Kevin Conner 2010-09-22 04:44:50 UTC
Attachment: Added: juddiv3.war.orig
Attachment: Added: juddiv3.war.new


Comment 3 Kevin Conner 2010-09-22 04:52:53 UTC
The WSDL associated with this service can be accessed via the following URL, http://127.0.0.1:8080/juddiv3/services/replication?wsdl, triggering the exception, however accessing any wsdl within the juddiv3 deployment will currently cause this issue due to a second CXF integration bug.

Comment 7 Darran Lofthouse 2010-10-19 12:09:16 UTC
From section 2.3.1.2 of the JAX-WS specification the wrapper style restrictions are defined as: -

2.3.1.2 Wrapper Style
A WSDL operation qualifies for wrapper style mapping only if the following criteria are met:
   (i) The operation’s input and output messages (if present) each contain only a single part
  (ii) The input message part refers to a global element declaration whose localname is equal to the opera-
       tion name
 (iii) The output message (if present) part refers to a global element declaration
 (iv) The elements referred to by the input and output message (if present) parts (henceforth referred to as
       wrapper elements) are both complex types defined using the xsd:sequence compositor
May 7, 2007                                     JAX-WS 2.1                                               13
Chapter 2. WSDL 1.1 to Java Mapping
 (v) The wrapper elements only contain child elements, they MUST not contain other structures such
     as wildcards (element or attribute), xsd:choice, substitution groups (element references are not
     permitted) or attributes; furthermore, they MUST not be nillable.

It is v above being violated and the endpoint should not be wrapped so this is a tooling issue in the generated endpoint.


Comment 8 Kevin Conner 2010-10-19 12:18:14 UTC
In that case I would be tempted to reject this issue as this is jUDDI WSDL and not, to the best of my knowledge, generated by any tool.

I can modify my local version of the jUDDI WSDL in the meantime.

Comment 9 Kevin Conner 2010-10-19 12:58:07 UTC
This is a jUDDI bug, we will override the schema within the ESB build.

Comment 10 Kevin Conner 2010-10-19 13:02:01 UTC
Link: Added: This issue depends JBESB-3512


Comment 11 Kevin Conner 2010-10-19 13:02:25 UTC
Link: Removed: This issue depends JBESB-3512 


Comment 12 Mustafa Musaji 2011-04-07 14:57:52 UTC
Link: Added: This issue Cloned to SOA-3014



Note You need to log in before you can comment on or make changes to this bug.