3 Replies Latest reply on Apr 17, 2008 2:57 PM by bsheward

    Cannot extract schema definition?

      Hi,

      I developed a very simple web service, using wsconsume against a URL for WSDL to create a set of objects, and then the following code:

       public void runQuery( String username, String password, String query) {
       RemoteService service = new RemoteService ();
       RemotePortType rem= service.getRemotePort();
       System.out.println("Server said: " + rem.getRemoteResult( query, username, password));
       }
      


      I get an Exception when instantiating the RemoteService:

      Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.IOException: The file
      name, directory name, or volume label syntax is incorrect
       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.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:85)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:131)
       at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
       at javax.xml.ws.Service.<init>(Service.java:83)
       at com.mycom.platforms.bf.webclient.RemoteService.<init>(RelevanceService.java:40)
       at com.mycom.platforms.bf.BFRemoteServiceClient.runQuery(BigFixRelevanceServiceClient.java:27)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       ... 39 more
      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.IOException: The filename, directory name, or volume label synt
      ax is incorrect
       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)
       ... 59 more
      Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
       at java.io.WinNTFileSystem.createFileExclusively(Native Method)
       at java.io.File.checkAndCreate(File.java:1704)
       at java.io.File.createTempFile(File.java:1793)
       at org.jboss.ws.metadata.wsdl.xsd.SchemaUtils.getSchemaTempFile(SchemaUtils.java:535)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processSchemaInclude(WSDL11Reader.java:529)
       at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:375)
       ... 61 more
      


      One potential issue I can think of is that I am calling this web service while in a Session Bean exposed as a web service.

      Could anyone give me any other pointers?

      Thanks,

      Barry


        • 1. Re: Cannot extract schema definition? [FIXED]

          OK, I figured out the problem, it was because there was a "?" in the URL, which wasn't translated into something that the Windows Filesystem could cope with.

          I fixed the problem by making the highlighted changes to getSchemaTempFile() in org.jboss.ws.metadata.wsdl.xsd.SchemaUtils:

           /** Get the temp file for a given namespace
           */
           public static File getSchemaTempFile(String targetNS) throws IOException
           {
           if (targetNS.length() == 0)
           throw new IllegalArgumentException("Invalid null target namespace");
          
           String fname = targetNS;
           if (fname.indexOf("://") > 0)
           fname = fname.substring(fname.indexOf("://") + 3);
          
           File tmpdir = null;
           try
           {
           SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
           ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
           tmpdir = serverConfig.getServerTempDir();
           tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
           tmpdir.mkdirs();
           }
           catch (Throwable th)
           {
           // ignore if the server config cannot be found
           // this would be the case if we are on the client side
           }
          
           fname = fname.replace('/', '_');
           fname = fname.replace(':', '_');
           fname = fname.replace('?', '_');
          
           File file = null;
           try {
           file = File.createTempFile("JBossWS_" + fname, ".xsd", tmpdir);
           } catch (IOException x) {
           System.out.println("FILE: JBossWS_" + fname);
           System.out.println("TMPDIR: " + tmpdir.getCanonicalFile());
           throw x;
           }
           return file;
           }
          


          • 2. Re: Cannot extract schema definition?
            ropalka

            It will be fixed in next release, see:

            http://jira.jboss.org/jira/browse/JBWS-2153

            Thanks for your investigation ;)

            • 3. Re: Cannot extract schema definition?

              You're welcome! Thanks for JBossWS !