<!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;">
Problem using xsd:import in WSDL (JBoss 7.2.0 Alpha1)
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/timo.hirt">Timo Hirt</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/758066#758066">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Currently I attempt to define some common types to be used in multiple WSLDs into a xsd file WorkPackageServiceTypes.xsd as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="jive-xml-tag"><span><schema xmlns="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a><span>"
          targetNamespace="</span><a class="jive-link-external-small" href="http://www.example.com/Common/WorkPackageServiceTypes" target="_blank">http://www.example.com/Common/WorkPackageServiceTypes</a><span>"
          xmlns:tns="</span><a class="jive-link-external-small" href="http://www.example.com/Common/WorkPackageServiceTypes" target="_blank">http://www.example.com/Common/WorkPackageServiceTypes</a><span>"
          elementFormDefault="qualified"></span></span>
          <span class="jive-xml-tag"><complexType name="WorkPackageType"></span>
                    <span class="jive-xml-tag"><sequence></span>
                              <span class="jive-xml-tag"><element name="Id" type="long"
                                        maxOccurs="1" minOccurs="1"></span>
                              <span class="jive-xml-tag"></element></span>
                              <span class="jive-xml-tag"><element name="StartDate" type="dateTime"
                                        maxOccurs="1" minOccurs="1"></span>
                              <span class="jive-xml-tag"></element></span>
                              <span class="jive-xml-tag"><element name="EndDate" type="dateTime"
                                        maxOccurs="1" minOccurs="1"></span><span class="jive-xml-tag"></element></span>
                    <span class="jive-xml-tag"></sequence></span>
          <span class="jive-xml-tag"></complexType></span>
<span class="jive-xml-tag"></schema></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I import this XSD into the WSDL of a service. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><span><wsdl:definitions xmlns:soap="</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/soap/" target="_blank">http://schemas.xmlsoap.org/wsdl/soap/</a><span>"
          xmlns:tns="</span><a class="jive-link-external-small" href="http://www.example.org/WorkPackageService/" target="_blank">http://www.example.org/WorkPackageService/</a><span>"
          xmlns:wsdl="</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/" target="_blank">http://schemas.xmlsoap.org/wsdl/</a><span>" xmlns:xsd="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a><span>"
          name="WorkPackageService" targetNamespace="</span><a class="jive-link-external-small" href="http://www.example.org/WorkPackageService/" target="_blank">http://www.example.org/WorkPackageService/</a><span>"></span></span>
          <span class="jive-xml-tag"><wsdl:types></span>
                    <span class="jive-xml-tag"><span><xsd:schema xmlns:xsd="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a><span>" xmlns:pref="</span><a class="jive-link-external-small" href="http://www.example.com/Common/WorkPackageServiceTypes" target="_blank">http://www.example.com/Common/WorkPackageServiceTypes</a><span>"
                              targetNamespace="</span><a class="jive-link-external-small" href="http://www.example.org/WorkPackageService/" target="_blank">http://www.example.org/WorkPackageService/</a><span>"></span></span>
                              <span class="jive-xml-tag"><span><xsd:import schemaLocation="WorkPackageServiceTypes.xsd"
                                        namespace="</span><a class="jive-link-external-small" href="http://www.example.com/Common/WorkPackageServiceTypes" target="_blank">http://www.example.com/Common/WorkPackageServiceTypes</a><span>"></span></span><span class="jive-xml-tag"></xsd:import></span>
          ..
         <span class="jive-xml-tag"></wsdl:types></span>
<span class="jive-xml-tag"></wsdl:definitions></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Both WSDL and XSD are located into the same folder (META-INF/wsdl/). wsconsume as well as the maven codegen plugin from the CXF project created all classes and stubs as expected. The web service is implemented as stateless session bean. If I deploy it to JBoss AS the following exception occurs during deployment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">15:38:03,890 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."Demo Project-0.0.1.ear"."webservices-ejb-layer-0.0.1.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Demo Project-0.0.1.ear"."webservices-ejb-layer-0.0.1.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "webservices-ejb-layer-0.0.1.jar" of deployment "Demo Project-0.0.1.ear"
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_27]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_27]
          at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_27]
Caused by: java.lang.RuntimeException: Cannot publish wsdl to: D:\dev\jboss-as-7.2.0.Alpha1-SNAPSHOT\standalone\data\wsdl\Demo Project-0.0.1.ear\webservices-ejb-layer-0.0.1.jar\WorkPackageService.wsdl
          at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:107)
          at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.publishContractToFilesystem(EndpointImpl.java:133)
          at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:75)
          at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:246)
          at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:525)
          at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:119)
          at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:129)
          at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:68)
          at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
          ... 5 more
Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/wsdl/Demo%20Project-0.0.1.ear/webservices-ejb-layer-0.0.1.jar/WorkPackageServiceTypes.xsd' not found for VirtualFile: "/D:/dev/jboss-as-7.2.0.Alpha1-SNAPSHOT/bin/content/Demo Project-0.0.1.ear/webservices-ejb-layer-0.0.1.jar"
          at org.jboss.as.webservices.util.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:62)
          at org.jboss.ws.common.deployment.ResourceResolverImpl.resolve(ResourceResolverImpl.java:79)
          at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:223)
          at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)
          at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)
          at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:94)
          ... 14 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is this a bug or am I doing anything wrong?</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/758066#758066">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>