|
Hi, Now I have an enumeration class which is generated by
WSDL2Java. My questions is how to create an instance for this enumeration class. Since the enumeration class has protected constructor, I
cannot use “SummaryRequestType requestType = new SummaryRequestType("SUMMARY
");” to create an instance. It says “SummaryRequestType(java.lang.String)
has protected access in …….” I did some search on this mail list, but still cannot get
some clue. Could someone give me a hint? Any info will be appreciated. Thanks, Helen Here is the enumeration and client file. package com.i3archive.www.RID_xsd1; public class SummaryRequestType implements
java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_
= new java.util.HashMap(); // Constructor protected
SummaryRequestType(java.lang.String value) { _value_ = value;
_table_.put(_value_,this); } public static final java.lang.String
_value1 = "SUMMARY-RADIOLOGY"; public static final java.lang.String
_value2 = "SUMMARY-CARDIOLOGY"; public static final java.lang.String
_value3 = "SUMMARY"; public static final SummaryRequestType
value1 = new SummaryRequestType(_value1); public static final SummaryRequestType
value2 = new SummaryRequestType(_value2); public static final SummaryRequestType
value3 = new SummaryRequestType(_value3); public java.lang.String getValue() {
return _value_;} public static SummaryRequestType
fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
SummaryRequestType enumeration = (SummaryRequestType)
_table_.get(value); if
(enumeration==null) throw new java.lang.IllegalArgumentException(); return
enumeration; } public static SummaryRequestType
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_);} public static
org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) { return new
org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType); } public static
org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) { return new
org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType); } // Type metadata private static
org.apache.axis.description.TypeDesc typeDesc = new
org.apache.axis.description.TypeDesc(SummaryRequestType.class); static {
typeDesc.setXmlType(new
javax.xml.namespace.QName("http://www.i3archive.com/RID.xsd1",
"summaryRequestType")); } /** * Return type metadata object */ public static
org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } } package com.i3archive.www.RID_wsdl; import org.apache.axis.AxisFault; import org.apache.axis.utils.Options; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode;
public class Client { public static void main(String [] args)
throws Exception {
com.i3archive.www.RID_xsd1.SummaryRequestType requestType = new com.i3archive.www.RID_xsd1.SummaryRequestType("SUMMARY"); java.lang.String
patientID = "whoever"; java.util.Calendar
lowerDateTime = java.util.Calendar.getInstance(); java.util.Calendar
upperDateTime = java.util.Calendar.getInstance(); org.apache.axis.types.PositiveInteger
mostRecentResults = new org.apache.axis.types.PositiveInteger("12"); RID service
= new RIDLocator();
IHERetrieveForDisplayHttpGet bean = service.getRIDPort();
System.out.println(bean.retrieveSummaryInfo(requestType, patientID,
lowerDateTime, upperDateTime, mostRecentResults)); } } |
- Help -- Implement Enumeration on Client Side Zhixiang He
- RE: Help -- Implement Enumeration on Client Side Grossberger, Guenter
- RE: Help -- Implement Enumeration on Client Side Zhixiang He
