Re: problems with jaxme and axis2

2007-05-31 Thread Jochen Wiedmann

Hi, Karl-Heinz,

first of all, please be so kind to subscribe to the jaxme-dev mailing
list, before posting. Otherwise, I have to approve any mail from you
manually, which takes time. Apart from that, you risk that I decide
wrong, because your mail is just one within a bunch of spam mails,
which I reject.

On 5/29/07, Karl Heinz [EMAIL PROTECTED] wrote:


I found out, that a similar bug has been detected about a year ago.

see http://issues.apache.org/jira/browse/AXIS2-534


Right, the problem is just like described there:


xs:element name=Message type=ns:Message /
xs:complexType name=Message


You have an element and a complexType, which are both named Message.
In other words, the generator would like to create two different
classes, both named Message, which he rejects.

Either rename the element or the type (don't use the name
MessageType, btw, which is a similar gotcha), or use a custom
binding element like jxb:class to rename either of the generated
classes. See

   
http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html#wp148576

for renaming classes.


Jochen


--
Women have the ability to wind you round their little finger.
Daughters can use all of the fingers together.

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



problems with jaxme and axis2

2007-05-29 Thread Karl Heinz
Hi there,

I am trying to use jaxme as databinding with axis2. When I call the tool 
wsdl2java I get the following exception:

Exception in thread main 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.RuntimeException: java.lang.IllegalStateException: The class 
com.example.somwhere.xsd.Message has already been created.
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.IllegalStateException: The 
class com.example.somwhere.xsd.Message has already been created.
at 
org.apache.axis2.wsdl.codegen.extension.JaxMeExtension.engage(JaxMeExtension.java:158)
at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:209)
... 2 more
Caused by: java.lang.IllegalStateException: The class 
com.example.somwhere.xsd.Message has already been created.
at 
org.apache.ws.jaxme.js.JavaSourceFactory.newJavaSource(JavaSourceFactory.java:129)
at 
org.apache.ws.jaxme.generator.sg.impl.JAXBObjectSG.getXMLInterface(JAXBObjectSG.java:197)
at 
org.apache.ws.jaxme.generator.sg.impl.ObjectSGImpl.getXMLInterface(ObjectSGImpl.java:40)
at 
org.apache.ws.jaxme.generator.sg.impl.JAXBObjectSG.generate(JAXBObjectSG.java:278)
at 
org.apache.ws.jaxme.generator.sg.impl.ObjectSGImpl.generate(ObjectSGImpl.java:56)
at 
org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaSG.generate(JAXBSchemaSG.java:228)
at 
org.apache.ws.jaxme.generator.sg.impl.SchemaSGImpl.generate(SchemaSGImpl.java:67)
at 
org.apache.ws.jaxme.generator.impl.GeneratorImpl.generate(GeneratorImpl.java:148)
at 
org.apache.axis2.wsdl.codegen.extension.JaxMeExtension.engage(JaxMeExtension.java:126)

I found out, that a similar bug has been detected about a year ago. 

see http://issues.apache.org/jira/browse/AXIS2-534

My wsdl file looks as follows:

wsdl:definitions
xmlns:axis2=http://example.com/somwhere;
xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/;
xmlns:http=http://schemas.xmlsoap.org/wsdl/http/;
xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
xmlns:ns=http://example.com/somwhere/xsd;
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
targetNamespace=http://example.com/somwhere;
wsdl:types
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
attributeFormDefault=qualified 
elementFormDefault=qualified
targetNamespace=http://example.com/somwhere/xsd;
xs:element name=store
xs:complexType
xs:sequence
xs:element name=param0 
nillable=true
type=ns:Message /
/xs:sequence
/xs:complexType
/xs:element
xs:element name=Message type=ns:Message /
xs:complexType name=Message
xs:sequence
xs:element maxOccurs=unbounded 
name=l1List
nillable=true 
type=ns:Param1 /
xs:element maxOccurs=unbounded 
name=l3List
nillable=true 
type=ns:Param2 /
/xs:sequence
/xs:complexType
xs:element name=Param1 type=ns:Param1 /
xs:complexType name=Param1
xs:sequence
xs:element name=Element1 
nillable=true
type=xs:long /
/xs:sequence
/xs:complexType

xs:element name=Param2 type=ns:Param2 /
xs:complexType name=Param2
xs:sequence
xs:element name=Element2 
nillable=true
type=xs:string /
/xs:sequence
/xs:complexType
xs:element name=storeResponse
xs:complexType
xs:sequence
xs:element name=return 
nillable=true
type=xs:boolean /
/xs:sequence
/xs:complexType