بتاريخ: 8 سبتمبر 20169 سنة comment_277882 السلام عليكم الرجاء مساعدتي أنا أريد أن أستدعي ويب سيرفيس عن طريق oracle 10g version 10.2.0.1.0 و الويب سيرفس ببعتلها Parameters شكرا لكم تقديم بلاغ
بتاريخ: 9 سبتمبر 20169 سنة comment_277919 PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS soap_request VARCHAR2(30000); soap_respond CLOB; http_req utl_http.req; http_resp utl_http.resp; resp XMLType; soap_err exception; v_code VARCHAR2(200); v_msg VARCHAR2(1800); v_len number; v_txt Varchar2(32767); BEGIN UTL_HTTP.SET_PROXY(p_proxy); -- Define the SOAP request according the the definition of the web service being called soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'|| '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'|| ' <SOAP-ENV:Body>'|| ' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'|| ' <m:UserName>'||p_username||'</m:UserName>'|| ' <m:Password>'||p_password||'</m:Password>'|| ' </m:DownloadRequest>'|| ' </SOAP-ENV:Body>'|| '</SOAP-ENV:Envelope>'; http_req:= utl_http.begin_request ( 'http://www.website.net/webservices/GetDetailsService.asmx' , 'POST' , 'HTTP/1.1' ); utl_http.set_header(http_req, 'Content-Type', 'text/xml'); utl_http.set_header(http_req, 'Content-Length', length(soap_request)); utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service utl_http.write_text(http_req, soap_request); http_resp:= utl_http.get_response(http_req); utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K LOOP utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end); soap_respond := soap_respond || v_txt; -- build up CLOB END LOOP; utl_http.end_response(http_resp); resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE END; تقديم بلاغ
بتاريخ: 20 مايو 20178 سنة comment_286856 ممن شرح لطؤيقة استدعاء ال web service PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS soap_request VARCHAR2(30000); soap_respond CLOB; http_req utl_http.req; http_resp utl_http.resp; resp XMLType; soap_err exception; v_code VARCHAR2(200); v_msg VARCHAR2(1800); v_len number; v_txt Varchar2(32767); BEGIN UTL_HTTP.SET_PROXY(p_proxy); -- Define the SOAP request according the the definition of the web service being called soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'|| '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'|| ' <SOAP-ENV:Body>'|| ' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'|| ' <m:UserName>'||p_username||'</m:UserName>'|| ' <m:Password>'||p_password||'</m:Password>'|| ' </m:DownloadRequest>'|| ' </SOAP-ENV:Body>'|| '</SOAP-ENV:Envelope>'; http_req:= utl_http.begin_request ( 'http://www.website.net/webservices/GetDetailsService.asmx' , 'POST' , 'HTTP/1.1' ); utl_http.set_header(http_req, 'Content-Type', 'text/xml'); utl_http.set_header(http_req, 'Content-Length', length(soap_request)); utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service utl_http.write_text(http_req, soap_request); http_resp:= utl_http.get_response(http_req); utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K LOOP utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end); soap_respond := soap_respond || v_txt; -- build up CLOB END LOOP; utl_http.end_response(http_resp); resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE END; عن طريق procedure لانو المثال الموجود مش مفهوم بالنسبة الي من فضلك تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.