on 02-04-2009 3:54 PM
Hi,
I need to implement a web service for an enterprise java bean that it return a Vector of complex type Concorso[] as follow:
public class Concorso implements Serializable{
String anno;
String stato;
String data_fin;
String data_in;
String descrizione;
String id_conc;
public Concorso(){
}
public String getAnno(){
return this.anno;
}
public String getStato(){
return this.stato;
}
public String getDataFin(){
return this.data_fin;
}
public String getDataIn(){
return this.data_in;
}
public String getDescrizione(){
return this.descrizione;
}
public String getIdConc(){
return this.id_conc;
}
public void setAnno(String anno){
this.anno = anno;
}
public void setStato(String stato){
this.stato = stato;
}
public void setDataFin(String data_fin){
this.data_fin = data_fin;
}
public void setDataIn(String data_in){
this.data_in = data_in;
}
public void setDescrizione(String descr){
this.descrizione = descr;
}
public void setIdConc(String id_conc){
this.id_conc = id_conc;
}
}
This is the business method:
public Concorso[] getListConcorsi() {
// TODO : Implement
Vector toReturn = new Vector();
Concorso[] concorsoarray = null;
Zhr_Concorsi_Output output = null;
JCO.Client jcoclient = JCO.createClient("xxx","xxxx", "xxxxx",
"xx",
"xxxxxxxxx",
"xx");
jcoclient.connect();
Zhr_Concorsi_Input input = new Zhr_Concorsi_Input();
Zconcorsi_PortType myproxy = new Zconcorsi_PortType();
myproxy.messageSpecifier.setJcoClient(jcoclient);
try{
output = myproxy.zhr_Concorsi(input);
}catch(ApplicationFaultException ex){
ex.printStackTrace();
}catch(SystemFaultException ex){
ex.printStackTrace();
}
ZconcorsiType_List concorsi = output.get_as_listZconc();
for(int i=0; i<concorsi.size(); i++)
{
ZconcorsiType elem = concorsi.getZconcorsiType(i);
String anno = elem.getAnno();
String stato = elem.getStato();
String id_conc = elem.getId_Conc();
String data_in = elem.getData_In().toString();
String data_fin = elem.getData_Fin().toString();
String descr = elem.getDescr();
Concorso conc = new Concorso();
conc.setAnno(anno);
conc.setStato(stato);
conc.setIdConc(id_conc);
conc.setDataIn(data_in);
conc.setDataFin(data_fin);
conc.setDescrizione(descr);
toReturn.add(i,conc);
}
jcoclient.disconnect();
concorsoarray = new Concorso[toReturn.size()];
toReturn.toArray(concorsoarray);
return concorsoarray;
}
The method return a vector of Concorso elements.
Now, when I inovke the web service I have a error: "Exception in method getListConcorsi"
How can I solve this problem?
Many thanks!!!
I solved the problem!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.