Bonsoir,
je suis sur oracle xe et jdevelopper 11g , j'ai creer les services web en busness compment dans jdev , je les ai déployé et tester l'url avec succès :localhost:7001/semep/AppModuleService,
j'obtiens en résultat ce bloc xml :
maintenant je voudrais invoqué ces services avec des fonctions ou procedures SOAP :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
27
28
29
30 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <ns0:getSemepView1Response xmlns:ns0="/Sp/common/types/"> <ns1:result xmlns:ns1="/Sp/common/types/" xmlns:ns0="/Sp/common/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:SemepViewSDO"> <ns0:IdSemep>1</ns0:IdSemep> <ns0:NomSemep xsi:nil="true"/> <ns0:IdAdresse xsi:nil="true"/> <ns0:Email xsi:nil="true"/> <ns0:PhoneNumber xsi:nil="true"/> <ns0:MobilePhoneNumber xsi:nil="true"/> <ns0:ResponsableId xsi:nil="true"/> <ns0:Url xsi:nil="true"/> </ns1:result> </ns0:getSemepView1Response> </env:Body> </env:Envelope>
ça me retourne une erreur , je n'ai pas su écrire le:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
27
28
29
30
31
32
33 declare soap_request varchar2(30000); soap_respond varchar2(30000); http_req utl_http.req; http_resp utl_http.resp; resp XMLType; i integer; begin soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <soap:Body xmlns:ns1="/Sp/common/types/"> <ns1:getSemepView1> <ns1:idSemep>'||id||'</ns1:idSemep> </ns1:getSemepView1> </soap:Body> </soap:Envelope>'; http_req:= utl_http.begin_request ( 'http://'||url||'/Semep/AppModuleService' , '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 ('SEMEP is : '||soap_respond); resp:= resp.extract('//ns0:getSemepView1Response/ns1:result' , 'xmlns:ns0="/Sp/common/types/"' ); dbms_output.put_line('SEMEP : '||resp.getStringVal()); --return resp.getStringVal(); end;
resp:= resp.extract('//ns0:getSemepView1Response/ns1:result' , 'xmlns:ns0="/Sp/common/types/"' )
quelqu'un pourrai expliqué comment l'écrire? merci
Partager