Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.2.3
-
None
-
Unknown
Description
SCENARIO:
1. Given WSDL with data types defined inside (imports are not used).
2. Generate service interface and xml beans.
3. Create a client proxy using ClientProxyFactoryBean:
- use BARE parameter style;
- use XmlBeans data binding;
- do not specify WSDL location.
ACTUAL RESULT:
Exception in thread "main" org.apache.cxf.service.factory.ServiceConstructionException: Service class org.example.MyService method queryMethod part
{http://example.org/services/myservice}arg0 cannot be mapped to schema. Check for use of a JAX-WS-specific type without the JAX-WS service factory bean.
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createBareMessage(ReflectionServiceFactoryBean.java:1090)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:392)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:444)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:195)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
at org.example.services.MyServiceClient.main(MyServiceClient.java:52)
EXPECTED RESULT:
Successful creation of a client proxy.
ANALYSIS:
When the service model is build from the class the XmlBeansSchemaInitializer.mapClass() method is executed for web service data types.
The method contains the following condition:
if (sourceName.endsWith("wsdl"))
{ return; }Our source is WSDL with data types defined inside (imports are not used), so the MessagePartInfo attributes are not fully populated due to this condition. These attributes are missed and ReflectionServiceFactoryBean.createBareMessage() throws the exception.
I assume the condition should be removed and the logic should be updated to take into account definitions of data types contained in WSDL.