Hi, iksrazal. I have a more simple example. It is shown below.
--------------------------------------------------------------------------------
public class WorkStationServer2 {
private String sysDescr;
private long sysUpTime;
private String sysContact;
private String sysName;
private String sysLocation;
public WorkStationServer2() {
super();
sysDescr = "Linux workstation";
sysUpTime = java.lang.System.currentTimeMillis();
sysContact = "[EMAIL PROTECTED]";
sysName = "rt-dsp14";
sysLocation = "RT-DSP Laboratory";
}
public String getSysDescr() {
return sysDescr;
}
public long getSysUpTime() {
return java.lang.System.currentTimeMillis() - sysUpTime;
}
public String getSysContact() {
return sysContact;
}
public String getSysName() {
return sysName;
}
public String getSysLocation() {
return sysLocation;
}
public System getSystem() {
return new System(sysDescr,
java.lang.System.currentTimeMillis() - sysUpTime,
sysContact,
sysName,
sysLocation);
}
public PrColumn getColumn() {
return new PrColumn(0,"toto",0,0,0,0,"none",0,"none");
}
public PrTable getTable() {
PrColumn[] columns = new PrColumn[40];
for (int i = 0; i < 40; i++)
columns[i] = new PrColumn(i,"toto"+i,0,0,0,0,"none",0,"none");
return new PrTable(columns);
}
public class System {
public String sysDescr = null;
public long sysUpTime = (long)0;
public String sysContact = null;
public String sysName = null;
public String sysLocation = null;
public System () {
} // ctor
public System (String _sysDescr, long _sysUpTime, String _sysContact,
String _sysName, String _sysLocation) {
sysDescr = _sysDescr;
sysUpTime = _sysUpTime;
sysContact = _sysContact;
sysName = _sysName;
sysLocation = _sysLocation;
} // ctor
}
public class PrColumn {
public int prIndex = (int)0;
public String prNames = null;
public int prMin = (int)0;
public int prMax = (int)0;
public int prCount = (int)0;
public int prErrorFlag = (int)0;
public String prErrMessage = null;
public int prErrFix = (int)0;
public String prErrFixCmd = null;
public PrColumn () {
}
public PrColumn (int _prIndex, String _prNames, int _prMin, int _prMax,
int _prCount,
int _prErrorFlag, String _prErrMessage, int _prErrFix,
String
_prErrFixCmd) {
prIndex = _prIndex;
prNames = _prNames;
prMin = _prMin;
prMax = _prMax;
prCount = _prCount;
prErrorFlag = _prErrorFlag;
prErrMessage = _prErrMessage;
prErrFix = _prErrFix;
prErrFixCmd = _prErrFixCmd;
} // ctor
}
public class PrTable {
public PrColumn columns[] = null;
public PrTable () {
} // ctor
public PrTable (PrColumn[] _columns) {
columns = _columns;
} // ctor
}
}
--------------------------------------------------------------------------------
As you can see, It has complex types named 'System', 'PrColumn' and
'PrTable'.
After compile this source file, I put it in the
'/usr/local/jakarta-tomcat-4.1.31/webapps/axis/WEB-INF/classes/'
directory.
Next, I built the descriptor file shown below:
--------------------------------------------------------------------------------
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="WorkStationServer2" provider="java:RPC">
<parameter name="className" value="WorkStationServer2"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
---------------------------------------------------------------------------------
The next step was deploy the service, using the 'AdminClient'
application, as it shown below:
---------------------------------------------------------------------------------
# java org.apache.axis.client.AdminClient deploy2.wsdd
---------------------------------------------------------------------------------
After that, the stubs for a Client of that service were generated by
means of the WSDL2Java application, as it shown below:
---------------------------------------------------------------------------------
# java org.apache.axis.wsdl.WSDL2Java
http://localhost:8080/axis/services/WorkStationServer2?wsdl
---------------------------------------------------------------------------------
Finally, I built the Client. And, when that Client invokes the
'getSysDescr' method, it does work. But when it invokes the 'getSystem'
method, it does not work. More accurately, the following exception is
thrown:
----------------------------------------------------------------------------------
# An Axis Fault occurred: org.xml.sax.SAXParseException: Document root
element is missing.
-----------------------------------------------------------------------------------
Do you have any idea about what is going on? Is my descriptor file
correct?
Kindest regards.
Helcio Wagner.