You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2007/07/30 07:56:52 UTC

[jira] Commented: (AXIS2-3029) wsd2java no-namespace import error

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

Amila Chinthaka Suriarachchi commented on AXIS2-3029:
-----------------------------------------------------

hi,
first of all this is a very rare case. I saw these problems in your schema
1. first shema does not have a target namesapce.
2. second schema does not define default namespace but there is an element with out a namesace prefix.

Are these leagal according the namespace definitions?

Anyway if you do it in a properway as follows it works fine.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://some.namespace">
            <xs:element name="AccountBOS">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element type="xs:long" name="Account_ID"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
        <s:schema elementFormDefault="qualified" targetNamespace="http://some.namespace"
                  xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:acc="http://some.namespace">
            <s:import namespace="http://some.namespace"/>
            <s:element name="getAccount">
                <s:complexType>
                    <s:sequence>
                        <s:element ref="acc:AccountBOS"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
        </s:schema>


> wsd2java no-namespace import error
> ----------------------------------
>
>                 Key: AXIS2-3029
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3029
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.2
>         Environment: WinXP, jdk1.5
>            Reporter: Alex Rodriguez
>            Assignee: Amila Chinthaka Suriarachchi
>         Attachments: test.wsdl
>
>
> I have a wsdl that imports a schema with no namespace; I've attached a sample wsdl that generates the error. Trying to generate a client stub fails with both xmlbeans and adb, the error is:
> Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:256)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>         at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:103)
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:209)
>         ... 2 more
> Caused by: java.lang.reflect.InvocationTargetException
>         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:585)
>         at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:92)
>         ... 3 more
> Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error: src-resolve.a: Could not find element 'AccountBOS@http://some.namespace'. Do you mean to refer to the element named AccountBOS?
>         at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:310)
>         ... 8 more
> Caused by: org.apache.xmlbeans.XmlException: error: src-resolve.a: Could not find element 'AccountBOS@http://some.namespace'. Do you mean to refer to the element named AccountBOS?
>         at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
>         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:585)
>         at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
>         at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:174)
> I've independently run xmlbeans generation on this and it succeeds, correctly generating AccountBOS in noNamespace. The problem with wsdl2java is that the reference to AccountBOS is being assigned a namespace when it shouldn't be, this is an import, not an include.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org