<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Using XMLBeans binding for JAX-WS web services
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/weiqigao">Weiqi Gao</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/764639#764639">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My last post in this forum was made six years ago.  How's everybody?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I need to port some JAX-WS web services that use XMLBeans as the data binding from another application server.  I'm using JBoss AS 7.0.2 Final, but I could be using JBoss 7.1.1 Final as well.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I searched the forum and other internet sites and understand that this is possible in some twisted way.  My development process will be a</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  "Schemas for the parameters and return types first, generate XMLBeans for them using XMLBeans.  Then Java first using the XMLBeans in service methods and depends on the runtime to generate the WSDL."</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have a prototype of this development flow working with plain Apache CXF.  The trick is to put an CXF annotation onto the SEI class:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  @javax.jws.WebService</p><p>  @org.apache.cxf.annotations.DataBinding(import org.apache.cxf.xmlbeans.XmlBeansDataBinding.class)</p><p>  public interface Demo {</p><p>    DemoResponseDocument foo(DemoRequestDocument request);</p><p>  }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>where DemoRequestDocument and DemoResponseDocument are XMLBeans generated classes from the schema.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>And I'm trying to deploy it in JBoss.  I noticed that the cxf-rt-databinding-xmlbeans-2.4.1.jar is not included in the JBoss AS 7.0.2 Final distribution.  The XMLBeans jar is also absent from the distrubution.  I did put the cxf-rt-databinding-xmlbeans-2.4.1.jar file into the proper place and updated the module.xml file.  I put the xmlbeans-2.4.0.jar into my WEB-INF/lib directory.  When I deployed it into JBoss AS 7.0.2 Final, I got the following error that I did not see when I run it with CXF directly:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>15:49:15,623 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-13) register: jboss.ws:context=demo,endpoint=Demo</p><p><span>15:49:15,628 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-13) Creating Service {</span><a class="jive-link-external-small" href="http://foo.com/" target="_blank">http://foo.com/</a><span>}Demo from class foo.Demo</span></p><p>15:49:15,631 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-13) remove: jboss.ws:context=demo,endpoint=Demo</p><p>15:49:15,632 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-13) MSC00001: Failed to start service jboss.deployment.unit."demo.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."demo.war".INSTALL: Failed to process phase INSTALL of deployment "demo.war"</p><p>    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]</p><p>    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]</p><p>    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]</p><p>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_07]</p><p>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_07]</p><p>    at java.lang.Thread.run(Thread.java:722) [:1.7.0_07]</p><p><span>Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Service class foo.Demo method total part {</span><a class="jive-link-external-small" href="http://foo/" target="_blank">http://foo/</a><span>}DemoRequest cannot be mapped to schema. Check for use of a JAX-WS-specific type without the JAX-WS service factory bean.</span></p><p>    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)</p><p>    at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:88)</p><p>    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)</p><p>    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509)</p><p>    at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:116)</p><p>    at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:109)</p><p>    at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:132)</p><p>    at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.internalDeploy(AspectDeploymentProcessor.java:79)</p><p>    at org.jboss.as.webservices.deployers.TCCLDeploymentProcessor.deploy(TCCLDeploymentProcessor.java:42)</p><p>    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]</p><p>    ... 5 more</p><p><span>Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Service class foo.Demo method total part {</span><a class="jive-link-external-small" href="http://foo/" target="_blank">http://foo/</a><span>}DemoRequest cannot be mapped to schema. Check for use of a JAX-WS-specific type without the JAX-WS service factory bean.</span></p><p>    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createBareMessage(ReflectionServiceFactoryBean.java:1164)</p><p>    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:449)</p><p>    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:682)</p><p>    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:501)</p><p>    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)</p><p>    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)</p><p>    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)</p><p>    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:157)</p><p>    at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:202)</p><p>    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433)</p><p>    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)</p><p>    ... 14 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What am I missing?  I'd appreciate any helps or pointers.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/764639#764639">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>