CXF generates invalid wsdl for jax-ws annotated interfaces when using aegis databinding.
Problem is in generating schema for methods which have parameters annotated with @WebParam( name='...', header=true).
Such parameters are being duplicated in generated wsdl. For example:
This causes some clients totally not to work with such web service(soap ui doesn't complain somewhy).
Eclipse wsdl validator gives me this error:
"A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://service.common.example.com/,firstHeader'.
My investigation shows that:
1. This problem appears only when using aegis databinding.
2. This bug presented in versions which are >= 2.4.0 (last version without this bug is 2.3.9)
3. This happens only in wsdl that is being generated for importing through wsdl:import directive.
In my case original wsdl is <ws-url>/service?wsdl and one that is imported is <ws-url>/service?wsdl=ExampleService.wsdl
4. Debugging shows that problem is probably in ReflectionServiceFactoryBean. When service is starting, next chain of methods is called: buildServiceFromClass->...initializeParameter[many times]->...initializeWrappedSchema[many times]
initializeWrappedSchema method calls checkForElement(...) which adds duplications for header parameters in service object model(ServiceInfo instance).
Not sure why exactly this happens but hope that it will help you at least locate the problem.
I'm attaching maven project which demonstrates this problem.
In order to reproduce this bug using sample project attached:
1. "mvn jetty:run" in project directory
2. Open localhost:8080/CXFExampleService/service?wsdl=ExampleService.wsdl in the browser
Search for '<xsd:complexType name="buggyWsdlDef">' occurence in that wsdl.
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Assignee||Daniel Kulp [ dkulp ]|
|Fix Version/s||2.4.7 [ 12319492 ]|
|Fix Version/s||2.5.3 [ 12319491 ]|
|Resolution||Fixed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|