[ 
https://issues.apache.org/jira/browse/AXIS2-4598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13089565#comment-13089565
 ] 

Patrick Paulson commented on AXIS2-4598:
----------------------------------------

I was able to work around this, but it required the following changes:
I had to add specify my wsdl as:
- file:src/main/wsdl/<wsdlfile>

I had to modify the 'schemaLocations' in the wsdl and xsds to say:
schemaLocation="file:src/main/<xsd-file>"

Since these are not the correct relative path names, I don't know how this will 
work on different systems.


> WSDL2Java fails when wsdl is a file with a space in the pathname
> ----------------------------------------------------------------
>
>                 Key: AXIS2-4598
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4598
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.4.1
>            Reporter: Michael Thome
>
> 1. if the WSDL spec passed to WSDL2Java contains a space character, it is 
> simply prefixed with a "file:/" and interpreted as a URI.  This fails to 
> construct a valid URI when the filesystem pathname contains characters that 
> may not appear in URIs:
> Exception in thread "main" 
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>   at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:153)
>   ...
> Caused by: org.apache.axis2.AxisFault: java.net.URISyntaxException: Illegal 
> character in path at index 40: file:/C:/Users/something or other/foo.wsdl
>   at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>   at 
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:397)
>   ...
> Caused by: java.lang.RuntimeException: java.net.URISyntaxException: Illegal 
> character in path at index 40: file:/C:/Users/something or other/foo.wsdl
>   at 
> org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:63)
>   ...
> Caused by: java.net.URISyntaxException: Illegal character in path at index 
> 40: file:/C:/Users/something or other/foo.wsdl
>   ...
>    at java.net.URI.<init>(URI.java:578)
>   at 
> org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:57)
> 2. the WSDL URI may be escaped as it is passed in (e.g. 
> file:/C:/Users/something%20or%20other/foo.wsdl).  This allows the process to 
> proceed further, it fails to consider the possibility that the base name is 
> HTTP escaped, resulting in an exception setting the WSDL base URI:
> Exception in thread "main" 
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>   at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:159)
>   at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>   at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>   at java.lang.String.substring(String.java:1938)
>   at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getBaseURI(CodeGenerationEngine.java:341)
>   at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:151)
>   ... 2 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to