Bonjour , j'utilise oracle XE et jdevelopper11g lorsque j'invoque le service web par la procedure (soap) get_naissance par exemple qui est la suivante :
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
-- create or replace function get_naissance(id in varchar2, url in varchar2) return varchar2 as soap_request varchar2(30000);
declare
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
begin
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://communes/"> <env:Header/>
<env:Body> <ns1:getNaissanceFindById> <arg0>272001</arg0> </ns1:getNaissanceFindById> </env:Body> </env:Envelope> ';
http_req:= utl_http.begin_request ( 'http://localhost:7101/naissances-Naissances-webapp/naissanceWS' , 'POST' , 'HTTP/1.1' );
utl_http.set_header(http_req, 'Content-Type', 'application/soap+xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'SOAPAction', '');
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
DBMS_OUTPUT.PUT_LINE ('naissance is : '||soap_respond);
resp:= resp.extract('//ns2:getNaissanceFindByIdResponse/return' , 'xmlns:ns2="http://communes/"' );
-- dbms_output.put_line('naissance: '||resp.getStringVal());
-- return resp.getStringVal();
end; |
j'obtiens ce message d'erreur:
Citation:
naissance is : <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Body><S:Fault xmlns:ns4="http://schemas.xmlsoap.org/soap/envelope/"><S:Code><S:Value>S:Sender</S:Value></S:Code><S:Reason><S:Text xml:lang="fr">Cannot find dispatch method for {http://communes/}getNaissanceFindById</S:Text></S:Reason></S:Fault></S:Body></S:Envelope>
Fonction créée.
|
et pourtant getNaissanceFindById existe :
Code :
1 2 3 4 5 6 7
| /** <code>select o from Naissance o where o.naissanceid like :id</code> */
@RequestWrapper(className = "jaxws.overloaded.GetNaissanceFindById2")
@ResponseWrapper(className = "jaxws.overloaded.GetNaissanceFindById2_Response")
@WebMethod(operationName = "getNaissanceFindById_2")
public Naissance getNaissanceFindById(String id) {
RETURN (Naissance)em.createNamedQuery("Naissance.findById").setParameter("id", id).getSingleResult();
} |
aprés l'execution du service web:
Code :
1 2 3 4 5 6 7 8
| <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://communes/">
<env:Header/>
<env:Body>
<ns1:getNaissanceFindById_2>
<arg0>272001</arg0>
</ns1:getNaissanceFindById_2>
</env:Body>
</env:Envelope> |
et c'est comme sa pour chaque soap que je lance sauf pour un mais je ne vois pas la différence entre eux c'est la même syntaxe ....
quelqu'un a une idée svp merci je dois tester toute les fonctions car j'ai des erreur au niveau de la page edit de jdevelopper 11g ;
MERCI