[ 
https://issues.apache.org/jira/browse/CXF-2442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762586#action_12762586
 ] 

Michael Klimiuk edited comment on CXF-2442 at 10/6/09 4:29 AM:
---------------------------------------------------------------

Please find the fixed XmlBeansSchemaInitializer.java attached.

Not sure that this is a correct solution of the problem, but it worked for us.

That will be great if someone have a look and comment.

The original source was taken from the CXF 2.2.3 sources:

rt\databinding\xmlbeans\src\main\java\org\apache\cxf\xmlbeans\XmlBeansSchemaInitializer.java
 

      was (Author: mklimiuk):
    Not sure that this is a correct solution of the problem, it worked for us.

That will be great if someone have a look and comment this.

The original source was taken from the CXF 2.2.3 sources:

rt\databinding\xmlbeans\src\main\java\org\apache\cxf\xmlbeans\XmlBeansSchemaInitializer.java
 
  
> 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
>         Attachments: XmlBeansSchemaInitializer.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to