6 Replies Latest reply on Apr 6, 2010 4:21 AM by Hans Wolffenbuttel

    inXsd/outXsd using xs:include

    Morten Hauch Newbie

      Hi

       

      I'm exposing an esb service as webservice using the inXsd/outXsd approach.

       

      I have two services which returns the same xml snippet as part of the response. In my actions I would like to use jaxb to generate the responses.

       

      The natural way to do this would be to extract the snippet in a separate xsd, letting the response-xsd's include it (using xs:include). All xsd's are located in the root of the esb archive.

      But this gives me a wsdl exception (see below) saying that the referred xsd cannot be found.

       

      If I repeat the xsd snippet in my responses, I get a jaxb error during build, saying that the element already is defined - that said, I really don't like this way of doing it.

      It is easy enough to work around this be copying the snippet around with different names, but this is not exactly elegant....

       

      Do anybody have an example with in/out-Xsd referring to another xsd?

       

      Any help appreciated.

       

      Exception:

      13:10:44,256 ERROR [MainDeployer] Could not start deployment: file:/Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS.war org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyybWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:154)         at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)         at org.jboss.ws.metadata.builder.MetaDataBuilder.replaceAddressLocation(MetaDataBuilder.java:284)         at org.jboss.ws.metadata.builder.jaxws.JAXWSProviderMetaDataBuilder.buildProviderMetaData(JAXWSProviderMetaDataBuilder.java:147)         at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:55)         at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:63)         at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.create(UnifiedMetaDataDeploymentAspect.java:66)         at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(Unknown Source)         at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)         at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)         at $Proxy46.start(Unknown Source)         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)         at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         at java.lang.reflect.Method.invoke(Method.java:592)         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)         at $Proxy9.deploy(Unknown Source)         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:384)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:172)         at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:128)         ... 38 more Caused by: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:94)         at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:103)         at java.net.URL.openStream(URL.java:1007)         at org.jboss.ws.core.utils.ResourceURL.openStream(ResourceURL.java:57)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processSchemaInclude(WSDL11Reader.java:518)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:375)         ... 40 more