Salut les amis!!
J'essaie de recuperer tous les resultats ramenés par un web service. quand je teste teste le web service coté server il marche impécablement et me ramène toutes les lignes de resultats (7 lignes en tout pour le moment).
La où j'ai des ennuis c'est au moment de consommer ce web service. il ne me retourne qu'une seule ligne alors qu'il devait m'en ramener 7.
mon web service est écrit en java et est basé sur WSDL/SOAP.
voici son code:
@WebMethod(operationName = "ListePersonne")
PUBLIC List ListePersonne(){
STRING requete = "{call dbo.listePersonne()}";
List listeTotalPersonnes = new ArrayList();
try{
cst = connexion.getInstance().prepareCall(requete);
t = cst.execute();
IF(t == true){
rs = cst.getResultSet();
}
while (rs.next()) {
listeTotalPersonnes.add(rs.getString(1)+ " ** "+rs.getString(2)+ " ** "+rs.getString(3)+ " ** "+rs.getString(4)
+ " ** "+rs.getString(5)+ " ** "+rs.getString(6)+ " ** "+rs.getString(7)+ " ** "+rs.getString(8)+ " ** "+rs.getString(9)
+ " ** "+rs.getString(10)+ " ** "+rs.getString(11));
}
}catch(SQLException e){
e.getMessage();
}
return listeTotalPersonnes;
}
voici un aperçu du fichier WSDL génére:
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://jdbc.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://jdbc.com/" name="WSListePersonne">
<types>
<xsd:schema>
<xsd:import namespace="http://jdbc.com/" schemaLocation="http://localhost:8080/GESEC_WEBSERVICE_SERVER/WSListePersonne?xsd=1"/>
</xsd:schema>
</types>
<message name="ListePersonne">
<part name="parameters" element="tns:ListePersonne"/>
</message>
<message name="ListePersonneResponse">
<part name="parameters" element="tns:ListePersonneResponse"/>
</message>
<portType name="WSListePersonne">
<operation name="ListePersonne">
<input wsam:Action="http://jdbc.com/WSListePersonne/ListePersonneRequest" message="tns:ListePersonne"/>
<output wsam:Action="http://jdbc.com/WSListePersonne/ListePersonneResponse" message="tns:ListePersonneResponse"/>
</operation>
</portType>
<binding name="WSListePersonnePortBinding" type="tns:WSListePersonne">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="ListePersonne">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WSListePersonne">
<port name="WSListePersonnePort" binding="tns:WSListePersonnePortBinding">
<soap:address location="http://localhost:8080/GESEC_WEBSERVICE_SERVER/WSListePersonne"/>
</port>
</service>
</definitions>
enfin voila le code dans lequel je consomme le web service (le client est fait en windev):
gListePersonneResponse est WSListePersonne.ListePersonneResponse = WSListePersonne.ListePersonne()
n est un entier = 1
gsResultat est une chaîne
gtabLoListePersonne est un tableau de chaînes
gsResultat = ExtraitChaîne(gListePersonneResponse.'RETURN',rangPremier," ** ")
gsValeur1 est une chaîne = gsResultat
Ajoute(gtabLoListePersonne, gsResultat)
TANTQUE n < gListePersonneResponse.return..Occurrence OU gsResultat <>EOT
TableInsèreLigne(TABLE_LISTEPERSONNE,n,ExtraitChaîne(gListePersonneResponse.'RETURN',1," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',2," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',3," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',4," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',5," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',6," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',7," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',8," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',9," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',10," ** "),ExtraitChaîne(gListePersonneResponse.'RETURN',11," ** "))
SI ExtraitChaîne(gListePersonneResponse.'RETURN',12," ** ") = EOT ALORS
SORTIR
FIN
n++
FIN
J'AI TOUT ESSAYER MAIS JE NE PARVIENS QU'A RÉCUPÉRER UNE SEULE LIGNE: LA 1ERE EN OCCURRENCE.
J'ai BESOIN D'AIDE SVP. MERCIII!!!!!!