Code generation fails if a wsdl has schema imports and that wsdl is included in 
a service archive with useOriginalWsdl = true
-----------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-3365
                 URL: https://issues.apache.org/jira/browse/AXIS2-3365
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.3
         Environment: Any
            Reporter: Charitha Kankanamge
            Assignee: Amila Chinthaka Suriarachchi
            Priority: Critical


Steps to reproduce:
================
1. Create a service archive with including a WSDL which has schema import as 
follows.

<xsd:import namespace="http://charitha.org/"; 
schemaLocation="http://localhost/repo/calculator.xsd"/>

As you can see above, the schema is hosted in a URL repo.

2. Set useOriginalWsdl=true in services.xml
3. Deploy the service
4. Try to generate client using ?wsdl of the deployed service

Following exception occurs.
Retrieving schema at 
'calculatorService?xsd=http://localhost/repo/calculator.xsd', relative to 'http
://localhost:8080/axis2/services/'.
Exception in thread "main" 
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL

        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:150)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: javax.wsdl.WSDLException: WSDLException (at 
/wsdl:definitions/wsdl:types/xsd:schema): fau
ltCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 
'calculatorService?xsd=
http://localhost/repo/calculator.xsd', relative to 
'http://localhost:8080/axis2/services/'.: java.io
.IOException: Server returned HTTP response code: 500 for URL: 
http://localhost:8080/axis2/services/
calculatorService?xsd=http://localhost/repo/calculator.xsd
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:286)
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:105)
        ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for 
URL: 
http://localhost:8080/axis2/services/calculatorService?xsd=http://localhost/repo/calculator.xsd
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)
        at java.net.URL.openStream(URL.java:1007)
        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
        ... 11 more
 
This occurs due to the following schema reference in the generated wsdl, which 
is invalid.
schemaLocation="calculatorService?xsd=http://localhost/repo/calculator.xsd";




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to