fail to create a service model from class when: BARE parameter style, XmlBeans
data binding, XmlBeans' source is WSDL file
--------------------------------------------------------------------------------------------------------------------------
Key: CXF-2442
URL: https://issues.apache.org/jira/browse/CXF-2442
Project: CXF
Issue Type: Bug
Components: OtherDatabindings
Affects Versions: 2.2.3
Reporter: Michael Klimiuk
Priority: Blocker
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
net.tmobile.crm.omsoe.services.oms.impl.OMSService.createPort(OMSService.java:67)
at
net.tmobile.crm.omsoe.services.oms.impl.OMSService.getOMS(OMSService.java:52)
at org.sandbox.OMSTest.getPort(OMSTest.java:33)
at org.sandbox.OMSTest.main(OMSTest.java:67)
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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.