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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| CREATE OR REPLACE procedure test_ws_fedict
IS
http_req utl_http.req;
http_resp utl_http.resp;
request_env varchar2(32767) DEFAULT NULL;
response_env varchar2(32767) DEFAULT NULL;
begin
UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(TRUE);
-- Set proxy details if no direct net connection.
UTL_HTTP.set_proxy('http://<USER>:<PASS>@10.0.2.21:8070', NULL);
UTL_HTTP.set_persistent_conn_support(TRUE);
request_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://fsb.belgium.be/EchoService/v1_00">'
||'<soapenv:Header/><soapenv:Body><v1:Echo>Ceci est un test accent " </v1:Echo></soapenv:Body></soapenv:Envelope>';
dbms_output.put_line('Length of Request:' || length(request_env));
dbms_output.put_line ('Request: ' || request_env);
UTL_HTTP.set_wallet ('file:/Orasoftware/Oracle_wallet',<PASS>);
http_req := utl_http.begin_request('https://fsb.services.int.belgium.be/1.00/CPS_SecuredEchoService','POST', utl_http.HTTP_VERSION_1_1);
utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8');
utl_http.set_header(http_req, 'Content-Length', length(request_env));
utl_http.set_header(http_req, 'SOAPAction', '"Echo"');
utl_http.write_text(http_req, request_env);
dbms_output.put_line('');
http_resp := utl_http.get_response(http_req);
dbms_output.put_line('Response Received');
dbms_output.put_line('--------------------------');
dbms_output.put_line ( 'Status code: ' || http_resp.status_code );
dbms_output.put_line ( 'Reason phrase: ' || http_resp.reason_phrase );
utl_http.read_text(http_resp, response_env);
dbms_output.put_line('Response: ');
dbms_output.put_line(response_env);
utl_http.end_response(http_resp);
EXCEPTION
when others then
DBMS_OUTPUT.put_line('Sqlerrm');
DBMS_OUTPUT.put_line(sqlerrm);
DBMS_OUTPUT.put_line('SqlCode');
DBMS_OUTPUT.put_line(sqlcode);
DBMS_OUTPUT.put_line('UTL_HTTP.get_detailed_sqlerrm')
DBMS_OUTPUT.put_line(UTL_HTTP.get_detailed_sqlerrm);
end test_ws_fedict; |
Partager