254: l_local_nls VARCHAR2(200);
255: l_remote_nls VARCHAR2(200);
256: BEGIN
257:
258: iby_debug_pub.add('In unpack_results_url');
259:
260: -- Initialize status, errcode, errmessage to Success.
261: x_status := 0;
262: x_errcode := 0;
328: END LOOP;
329: END IF;
330: */
331:
332: iby_debug_pub.add('Exit unpack_results_url');
333:
334: EXCEPTION
335: WHEN OTHERS THEN
336: /* Return a status of -1 to the calling API to indicate
353: p_temp_var VARCHAR2(2);
354:
355: BEGIN
356:
357: iby_debug_pub.add('In get_baseurl');
358: iby_utility_pvt.get_property(iby_payment_adapter_pub.C_ECAPP_URL_PROP_NAME,x_baseurl);
359: --dbms_output.put_line('x_return_status = '|| x_return_status);
360:
361: --Raising Exception to handle errors if value is missing
371: IF( p_temp_var <> '?' ) THEN
372: x_baseurl := x_baseurl || '?';
373: END IF;
374:
375: iby_debug_pub.add('base url=' || x_baseurl);
376:
377: iby_debug_pub.add('Exit get_baseurl');
378:
379: END get_baseurl;
373: END IF;
374:
375: iby_debug_pub.add('base url=' || x_baseurl);
376:
377: iby_debug_pub.add('Exit get_baseurl');
378:
379: END get_baseurl;
380:
381:
560: l_postbody VARCHAR2(30000);
561:
562: l_dbg_mod VARCHAR2(100) := G_DEBUG_MODULE || '.post_request';
563: BEGIN
564: iby_debug_pub.add('Enter',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
565:
566: IF (SUBSTR(p_url,1,6)='https:') THEN
567: iby_debug_pub.add('SSL url; setting wallet',
568: iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
563: BEGIN
564: iby_debug_pub.add('Enter',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
565:
566: IF (SUBSTR(p_url,1,6)='https:') THEN
567: iby_debug_pub.add('SSL url; setting wallet',
568: iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
569:
570: iby_utility_pvt.get_property
571: (iby_security_pkg.C_SHARED_WALLET_LOC_PROP_NAME,l_walletpath);
564: iby_debug_pub.add('Enter',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
565:
566: IF (SUBSTR(p_url,1,6)='https:') THEN
567: iby_debug_pub.add('SSL url; setting wallet',
568: iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
569:
570: iby_utility_pvt.get_property
571: (iby_security_pkg.C_SHARED_WALLET_LOC_PROP_NAME,l_walletpath);
572: l_walletpath := iby_netutils_pvt.path_to_url(l_walletpath);
573: utl_http.set_wallet(l_walletpath,NULL);
574: END IF;
575: set_proxy(p_url);
576:
577: iby_debug_pub.add('starting req',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
578: -- [lmallick] : Bug# 12547109
579: -- pass the session_id to the ECServlet to create a more meaninful
580: -- WebAppsContext
581: l_postbody := p_postbody||'&' || 'pSessionId=' || icx_sec.g_session_id;
581: l_postbody := p_postbody||'&' || 'pSessionId=' || icx_sec.g_session_id;
582:
583: l_httpreq := utl_http.begin_request(p_url,'POST',null);
584:
585: iby_debug_pub.add('set headers',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
586: utl_http.set_header(l_httpreq,'Accept','text/plain');
587: utl_http.set_header(l_httpreq,'Content-type',
588: 'application/x-www-form-urlencoded');
589: utl_http.set_header(l_httpreq,'Content-length',
589: utl_http.set_header(l_httpreq,'Content-length',
590: TO_CHAR(length(l_postbody)));
591:
592:
593: iby_debug_pub.add('writing body',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
594:
595: utl_http.write_line(l_httpreq,l_postbody);
596: l_sent_req := true;
597: iby_debug_pub.add('reading resp',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
593: iby_debug_pub.add('writing body',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
594:
595: utl_http.write_line(l_httpreq,l_postbody);
596: l_sent_req := true;
597: iby_debug_pub.add('reading resp',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
598:
599: l_httpresp := UTL_HTTP.get_response(l_httpreq);
600: l_got_resp :=true;
601: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
597: iby_debug_pub.add('reading resp',iby_debug_pub.G_LEVEL_INFO,l_dbg_mod);
598:
599: l_httpresp := UTL_HTTP.get_response(l_httpreq);
600: l_got_resp :=true;
601: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
602: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
603:
604: BEGIN
605: LOOP
598:
599: l_httpresp := UTL_HTTP.get_response(l_httpreq);
600: l_got_resp :=true;
601: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
602: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
603:
604: BEGIN
605: LOOP
606: utl_http.read_text(l_httpresp,l_line,4000);
612: END;
613:
614: UTL_HTTP.end_response(l_httpresp);
615:
616: iby_debug_pub.add('Exit',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
617: EXCEPTION
618: WHEN OTHERS THEN
619: iby_debug_pub.add('err code=' || utl_http.get_detailed_sqlcode,
620: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
615:
616: iby_debug_pub.add('Exit',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
617: EXCEPTION
618: WHEN OTHERS THEN
619: iby_debug_pub.add('err code=' || utl_http.get_detailed_sqlcode,
620: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
621: iby_debug_pub.add('err msg=' || SUBSTR(utl_http.get_detailed_sqlerrm,1,150),
622: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
623:
616: iby_debug_pub.add('Exit',iby_debug_pub.G_LEVEL_PROCEDURE,l_dbg_mod);
617: EXCEPTION
618: WHEN OTHERS THEN
619: iby_debug_pub.add('err code=' || utl_http.get_detailed_sqlcode,
620: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
621: iby_debug_pub.add('err msg=' || SUBSTR(utl_http.get_detailed_sqlerrm,1,150),
622: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
623:
624: IF (l_got_resp) THEN
617: EXCEPTION
618: WHEN OTHERS THEN
619: iby_debug_pub.add('err code=' || utl_http.get_detailed_sqlcode,
620: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
621: iby_debug_pub.add('err msg=' || SUBSTR(utl_http.get_detailed_sqlerrm,1,150),
622: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
623:
624: IF (l_got_resp) THEN
625: UTL_HTTP.end_response(l_httpresp);
618: WHEN OTHERS THEN
619: iby_debug_pub.add('err code=' || utl_http.get_detailed_sqlcode,
620: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
621: iby_debug_pub.add('err msg=' || SUBSTR(utl_http.get_detailed_sqlerrm,1,150),
622: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
623:
624: IF (l_got_resp) THEN
625: UTL_HTTP.end_response(l_httpresp);
626: iby_debug_pub.add('close resp',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
622: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
623:
624: IF (l_got_resp) THEN
625: UTL_HTTP.end_response(l_httpresp);
626: iby_debug_pub.add('close resp',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
627: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
628: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
629: ELSIF (l_sent_req) THEN
630: UTL_HTTP.end_request(l_httpreq);
623:
624: IF (l_got_resp) THEN
625: UTL_HTTP.end_response(l_httpresp);
626: iby_debug_pub.add('close resp',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
627: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
628: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
629: ELSIF (l_sent_req) THEN
630: UTL_HTTP.end_request(l_httpreq);
631: iby_debug_pub.add('close req',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
624: IF (l_got_resp) THEN
625: UTL_HTTP.end_response(l_httpresp);
626: iby_debug_pub.add('close resp',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
627: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
628: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
629: ELSIF (l_sent_req) THEN
630: UTL_HTTP.end_request(l_httpreq);
631: iby_debug_pub.add('close req',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
632: END IF;
627: iby_debug_pub.add('resp status code:=' || l_httpresp.status_code,
628: iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
629: ELSIF (l_sent_req) THEN
630: UTL_HTTP.end_request(l_httpreq);
631: iby_debug_pub.add('close req',iby_debug_pub.G_LEVEL_ERROR,l_dbg_mod);
632: END IF;
633: RAISE;
634: END;
635: