Hello all,
I have the attached JobStatus Java class (using code generated from the
attached WSDL file using wsdl2java and then modified) as part of a web
service I'm developing. For reasons I don't understand, not all of the
fields in the object are deserialized correctly on the client side. In
particular, the "JobId" and "State" parts of the object are deserialized
correctly, while the "UserName", "JobName", "Queue", and "TimeUsed"
parts are not.
Using WireShark and JSWAT, I've been able to confirm that the client
application receives a SOAP response message containing all the relevant
fields. However, the deserializer objects either can't find or don't
invoke the proper methods to set the non-working fields correctly, so
they end up being set to null. I can't see any difference between the
type descriptions of the working fields and the non-working fields, so
I'm at a loss as far as what to try next.
Any suggestions would be greatly appreciated.
Thanks in advance,
--Troy
--
Troy Baer [EMAIL PROTECTED]
Science & Technology Support http://www.osc.edu/hpc/
Ohio Supercomputer Center 614-292-9701
package edu.osc.hpc;
//
// Copyright 2006, Ohio Supercomputer Center
// Some code generated using Apache Axis wdsl2java
//
public class JobStatus implements java.io.Serializable
{
private final static int UNKNOWN = -1;
private final static int QUEUED = 0;
private final static int HELD = 1;
private final static int STARTING = 2;
private final static int RUNNING = 3;
private final static int ENDING = 4;
private int runstate = -1;
String jobId;
String timeUsed;
String jobName;
String userName;
String queue;
String state;
// constructors
public JobStatus()
{
this.setTimeUsed(new Time("00:00:00"));
}
public JobStatus(String jobId, String userName, String jobName,
String state, String timeUsed, String queue)
{
this.setJobId(jobId);
this.setUserName(userName);
this.setJobName(jobName);
this.setState(state);
this.setTimeUsed(timeUsed);
this.setQueue(queue);
}
// methods
public boolean exists()
{
if ( this.runstate!=this.UNKNOWN )
{
return true;
}
return false;
}
public boolean isRunning()
{
if ( this.runstate==this.RUNNING )
{
return true;
}
return false;
}
public boolean isQueued()
{
if ( this.runstate==this.QUEUED )
{
return true;
}
return false;
}
public boolean isHeld()
{
if ( this.runstate==this.HELD )
{
return true;
}
return false;
}
public void setState(String state)
{
if ( state.equals("queued") ||
state.equals("Q") ||
state.equals("PD") ||
state.equals("Idle") )
{
this.state=state;
this.runstate=this.QUEUED;
}
else if ( state.equals("held") ||
state.equals("H") ||
state.equals("Hold") ||
state.equals("BatchHold") )
{
this.state = state;
this.runstate = this.HELD;
}
else if ( state.equals("starting") ||
state.equals("S") )
{
this.state = state;
this.runstate = this.STARTING;
}
else if ( state.equals("running") ||
state.equals("R") ||
state.equals("Running"))
{
this.state = state;
this.runstate = this.RUNNING;
}
else if ( state.equals("ending") ||
state.equals("E") )
{
this.state = state;
this.runstate = this.ENDING;
}
else
{
this.runstate=this.UNKNOWN;
}
}
public String State()
{
if ( this.runstate==this.QUEUED )
{
this.state = "queued";
}
else if ( this.runstate==this.HELD )
{
this.state = "held";
}
else if ( this.runstate==this.STARTING )
{
this.state = "starting";
}
else if ( this.runstate==this.RUNNING )
{
this.state = "running";
}
else if ( this.runstate==this.ENDING )
{
this.state = "ending";
}
else
{
this.state = "unknown";
}
return this.state;
}
public String getState()
{
return this.State();
}
void setTimeUsed(Time time)
{
this.timeUsed=time.HHMMSS();
}
void setTimeUsed(String time)
{
this.timeUsed=time;
}
public Time TimeUsed()
{
return new Time(this.timeUsed);
}
public String getTimeUsed()
{
return this.timeUsed;
}
void setQueue(String queue)
{
this.queue=queue;
}
public String Queue()
{
return this.queue;
}
public String getQueue()
{
return this.Queue();
}
void setJobName(String jobname)
{
this.jobName=jobname;
}
public String JobName()
{
return this.jobName;
}
public String getJobName()
{
return this.JobName();
}
void setUserName(String username)
{
this.userName=username;
}
public String UserName()
{
return this.userName;
}
public String getUserName()
{
return this.userName;
}
public void setJobId(String jobId)
{
this.jobId = jobId;
}
public String getJobId()
{
return this.jobId;
}
// The following bits of Lovecraftian horror started life (or is that un-death?)
// as autogenerated code from Apache Axis' wsdl2java, but that code had
// some serious problems with deserialization so it's been heavily modified.
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof JobStatus)) return false;
JobStatus other = (JobStatus) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.getJobId().equals(other.getJobId()))) &&
((this.getUserName().equals(other.getUserName()))) &&
((this.getJobName().equals(other.getJobName()))) &&
((this.getState().equals(other.getState()))) &&
((this.getTimeUsed().equals(other.getTimeUsed()))) &&
((this.getQueue().equals(other.getQueue())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getJobId() != null) {
_hashCode += getJobId().hashCode();
}
if (getUserName() != null) {
_hashCode += getUserName().hashCode();
}
if (getJobName() != null) {
_hashCode += getJobName().hashCode();
}
if (getState() != null) {
_hashCode += getState().hashCode();
}
if (getTimeUsed() != null) {
_hashCode += getTimeUsed().hashCode();
}
if (getQueue() != null) {
_hashCode += getQueue().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(JobStatus.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://hpc.osc.edu",
"JobStatus"));
org.apache.axis.description.ElementDesc jobIdField = new org.apache.axis.description.ElementDesc();
jobIdField.setFieldName("jobId");
jobIdField.setXmlName(new javax.xml.namespace.QName("", "JobId"));
jobIdField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
jobIdField.setMinOccurs(1);
jobIdField.setMinOccurs(1);
jobIdField.setNillable(false);
typeDesc.addFieldDesc(jobIdField);
org.apache.axis.description.ElementDesc userNameField = new org.apache.axis.description.ElementDesc();
userNameField.setFieldName("userName");
userNameField.setXmlName(new javax.xml.namespace.QName("", "UserName"));
userNameField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
userNameField.setMinOccurs(1);
userNameField.setMinOccurs(1);
userNameField.setNillable(false);
typeDesc.addFieldDesc(userNameField);
org.apache.axis.description.ElementDesc jobNameField = new org.apache.axis.description.ElementDesc();
jobNameField.setFieldName("jobName");
jobNameField.setXmlName(new javax.xml.namespace.QName("", "JobName"));
jobNameField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
jobNameField.setMinOccurs(0);
jobNameField.setMaxOccurs(1);
jobNameField.setNillable(true);
typeDesc.addFieldDesc(jobNameField);
org.apache.axis.description.ElementDesc stateField = new org.apache.axis.description.ElementDesc();
stateField.setFieldName("state");
stateField.setXmlName(new javax.xml.namespace.QName("", "State"));
stateField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
stateField.setMinOccurs(1);
stateField.setMaxOccurs(1);
stateField.setNillable(true);
typeDesc.addFieldDesc(stateField);
org.apache.axis.description.ElementDesc timeUsedField = new org.apache.axis.description.ElementDesc();
timeUsedField.setFieldName("timeUsed");
timeUsedField.setXmlName(new javax.xml.namespace.QName("", "TimeUsed"));
timeUsedField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
timeUsedField.setMinOccurs(0);
timeUsedField.setMaxOccurs(1);
timeUsedField.setNillable(true);
typeDesc.addFieldDesc(timeUsedField);
org.apache.axis.description.ElementDesc queueField = new org.apache.axis.description.ElementDesc();
queueField.setFieldName("queue");
queueField.setXmlName(new javax.xml.namespace.QName("", "Queue"));
queueField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
queueField.setMinOccurs(0);
queueField.setMaxOccurs(1);
queueField.setNillable(true);
typeDesc.addFieldDesc(queueField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
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.BeanSerializer(javaType,
xmlType,
typeDesc);
}
/**
* Get Custom Deserializer
*/
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.BeanDeserializer(javaType,
xmlType,
typeDesc);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://hpc.osc.edu" xmlns:impl="http://hpc.osc.edu" xmlns:intf="http://hpc.osc.edu" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://hpc.osc.edu">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="JobRequest">
<sequence>
<element name="RequestType" nillable="true" type="xsd:string"/>
<element name="JobName" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="MemLimit" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="TimeLimit" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="Queue" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="Architecture" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="Shell" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="OutputFile" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="ErrorFile" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="CombineOutErrStreams" minOccurs="0" maxOccurs="1" type="xsd:boolean"/>
<element name="NCPUs" minOccurs="0" maxOccurs="1" type="xsd:integer"/>
<element name="MultiNode_NodeList" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="MPP_Geometry" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="JobScript" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="JobStatus">
<sequence>
<element name="JobId" nillable="false" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<element name="UserName" nillable="false" minOccurs="1" maxOccurs="1" type="xsd:string"/>
<element name="JobName" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="State" nillable="true" type="xsd:string"/>
<element name="TimeUsed" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<element name="Queue" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfJobIds">
<sequence>
<element name="jobId" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="submitJobRequest">
<wsdl:part name="request" type="impl:JobRequest"/>
</wsdl:message>
<wsdl:message name="submitJobResponse">
<wsdl:part name="jobid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="listJobsRequest">
<wsdl:part name="showOtherUsersJobs" type="xsd:boolean"/>
</wsdl:message>
<wsdl:message name="listJobsResponse">
<wsdl:part name="jobids" type="impl:ArrayOfJobIds"/>
</wsdl:message>
<wsdl:message name="statJobRequest">
<wsdl:part name="jobid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="statJobResponse">
<wsdl:part name="status" type="impl:JobStatus"/>
</wsdl:message>
<wsdl:message name="cancelJobRequest">
<wsdl:part name="jobid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="cancelJobResponse">
</wsdl:message>
<wsdl:portType name="RMWS">
<wsdl:operation name="submitJob">
<wsdl:input name="submitJobRequest" message="impl:submitJobRequest"/>
<wsdl:output name="submitJobResponse" message="impl:submitJobResponse"/>
</wsdl:operation>
<wsdl:operation name="statJob">
<wsdl:input name="statJobRequest" message="impl:statJobRequest"/>
<wsdl:output name="statJobResponse" message="impl:statJobResponse"/>
</wsdl:operation>
<wsdl:operation name="cancelJob">
<wsdl:input name="cancelJobRequest" message="impl:cancelJobRequest"/>
<wsdl:output name="cancelJobResponse" message="impl:cancelJobResponse"/>
</wsdl:operation>
<wsdl:operation name="listJobs">
<wsdl:input name="listJobsRequest" message="impl:listJobsRequest"/>
<wsdl:output name="listJobsResponse" message="impl:listJobsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="RMWSSoapBinding" type="impl:RMWS">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="submitJob">
<wsdlsoap:operation soapAction="submitJob"/>
<wsdl:input name="submitJobRequest">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:input>
<wsdl:output name="submitJobResponse">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="statJob">
<wsdlsoap:operation soapAction="statJob"/>
<wsdl:input name="statJobRequest">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:input>
<wsdl:output name="statJobResponse">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="cancelJob">
<wsdlsoap:operation soapAction="cancelJob"/>
<wsdl:input name="cancelJobRequest">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:input>
<wsdl:output name="cancelJobResponse">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listJobs">
<wsdlsoap:operation soapAction="listJobs"/>
<wsdl:input name="listJobsRequest">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:input>
<wsdl:output name="listJobsResponse">
<wsdlsoap:body use="literal" namespace="http://hpc.osc.edu"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="RMWSService">
<wsdl:port name="RMWS" binding="impl:RMWSSoapBinding">
<wsdlsoap:address location="https://hpc.osc.edu/rmws/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]