Help with duplicate element and namespace names in wsdl

Johan Rask <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CACyPTvAY=31D0eqdnXVRoMwdYLvuA=AeXMcgXWWRta1eAwuAhg@mail.gmail.com>
We are using thirdparty wsdl files that we are generating java files with
using axis2 & xmlbeans.
 Now we have a problem that there are duplicate elements in different files
but with the same namespace.

Example:

    file1.wsdl => <xsd:element name="MyElementName">
    file2.wsdl => <xsd:element name="MyElementName">

So, the result is that the same file is generated twice from different wsdl
files so only the last file generated actually exists after file generation.

I was wondering if this really is correct or if it is a design flaw of the
wsdl files?

I found a flag that I can use different packages for the classes so now I
have

    com.package.MyElementName
    com.package.ext.MyElementName

However, it still does not work because axis (or xmlbeans) give me the
wrong class back.

Take a look at this example. I would assume that this would work but intead
I get a ClassCastException

java.lang.ClassCastException:
com.package.MyElementName.impl.MyElementNameDocumentImpl cannot be cast to
com.package.ext.MyElementNameDocument

    com.mypackage.ext.MyElementNameDocument doc1 =
       com.mypackage.ext.MyElementNameDocument.Factory.newInstance();
    doc1.addNewMyElementName();

    com.mypackage.ext.MyElementNameDocument doc2 =

com.mypackage.ext.MyElementNameDocument.Factory.parse(doc1.toString());


I would really appreciate any hints on this cause I am totally stuck...

Regards /Johan

Also posted on stackoverflow
http://stackoverflow.com/questions/12961053/is-it-possible-to-manage-duplicate-element-names-with-axis2-xmlbeans
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.