-
1. Re: Urgent Help requested ...support for enums..update jboss
t_skowronek Oct 25, 2006 4:04 PM (in response to sursha)Take a look at the following links. I think you will need to uses arrays.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC4.html#wp130550
http://www.w3.org/TR/wsdl
http://schemas.xmlsoap.org/soap/encoding/ -
2. Re: Urgent Help requested ...support for enums..update jboss
jason.greene Oct 27, 2006 12:45 AM (in response to sursha)We have java-wsdl support for old jdk 1.4 typesafe enums (see the JAX-RPC spec for examples).
When we release JAX-WS we will have jdk5 enum support.
-Jason -
3. Re: Urgent Help requested ...support for enums..update jboss
sursha Oct 28, 2006 3:18 AM (in response to sursha)Thank you. I was able to get enums working. I created a test wsdl with enums and generated code using wsdl2java. Used that code as a template in the web service and when jbossws autogenerated wsdl, it created enums !!
Cool. -
4. Re: Urgent Help requested ...support for enums..update jboss
joshua_hj Nov 7, 2006 6:39 PM (in response to sursha)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 JoshuaEXCEPTION 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()); } }
-
5. Re: Urgent Help requested ...support for enums..update jboss
sursha Nov 8, 2006 1:27 PM (in response to sursha)create your enum class in the following format.
public class SortingTypes implements java.io.Serializable
{
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected SortingTypes(java.lang.String value)
{
_value_ = value;
_table_.put(_value_,this);
}
public static final java.lang.String _ASC = "ASC";
public static final java.lang.String _DESC = "DESC";
public static final SortingTypes ASC = new SortingTypes(_ASC);
public static final SortingTypes DESC = new SortingTypes(_DESC);
public java.lang.String getValue() { return _value_;}
public static SortingTypes fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException
{
SortingTypes enumeration = (SortingTypes)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static SortingTypes fromString(java.lang.String value)
throws java.lang.IllegalArgumentException
{
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
} -
6. Re: Urgent Help requested ...support for enums..update jboss
tejasjani Jan 31, 2007 1:36 AM (in response to sursha)Hi,
can someone give any tips on how to modify the mapping file after writing the enum classes as described in previous post.
thanks