Hi,
I was trying to develop a parlay X web service, the MultimediaMessaging one. I have
managed to generate all java classes from the wsdl and xsd files provided by the
specification. Allthough, i am having a problem with enumerations. I have a type, named
"MessagePriority" (see below) that is mapped into a java enum file
"MessagePriority" (see below) . JBoss complains about the Enumeration type at
deploy time. When i remove the references to that type it works fine.
Does the generated code below is supported by JBossWS?
Can i use enumeration at all?
PS: Can you explain better how did you managed to get your enums work
Best Regards Joshua
|
| EXCEPTION
|
| 23:31:27,785 ERROR [MainDeployer] Could not create deployment:
file:/C:/Java/jboss-4.0.5.GA/server/all/deploy/MultimediaMessaging.war
| org.jboss.ws.WSException: JAX-RPC Enumeration type did not conform to expectations
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.handleJAXRPCEnumeration(SchemaTypeCreator.java:374)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:317)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:127)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.createFieldParticle(SchemaTypeCreator.java:607)
| at
org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:592)
|
| ##############################
| ##############################
|
| SCHEMA
|
| <xsd:simpleType name="MessagePriority">
| <xsd:restriction base="xsd:string">
| <xsd:enumeration value="Default"/>
| <xsd:enumeration value="Low"/>
| <xsd:enumeration value="Normal"/>
| <xsd:enumeration value="High"/>
| </xsd:restriction>
| </xsd:simpleType>
|
|
| ##############################
| ##############################
|
| JAVA
|
| @XmlEnum
| public enum MessagePriority {
|
| @XmlEnumValue("Default")
| DEFAULT("Default"),
| @XmlEnumValue("High")
| HIGH("High"),
| @XmlEnumValue("Low")
| LOW("Low"),
| @XmlEnumValue("Normal")
| NORMAL("Normal");
| private final String value;
|
| MessagePriority(String v) {
| value = v;
| }
|
| public String value() {
| return value;
| }
|
| public static MessagePriority fromValue(String v) {
| for (MessagePriority c: MessagePriority.values()) {
| if (c.value.equals(v)) {
| return c;
| }
| }
| throw new IllegalArgumentException(v.toString());
| }
|
| }
|
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983950#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...