龙空技术网

oracle调用webservice

皮卡丘小李 106

前言:

此刻你们对“oracleutl_http”都比较讲究,大家都想要分析一些“oracleutl_http”的相关知识。那么小编在网摘上汇集了一些关于“oracleutl_http””的相关文章,希望我们能喜欢,我们快快来了解一下吧!

create or replace function FUNC_GENERATE_LOGINNAME(content VARCHAR2,cellNumber VARCHAR2,sender VARCHAR2)

return VARCHAR2 AS

l_service sys.utl_dbws.SERVICE;

l_call sys.utl_dbws.call;

l_result ANYDATA;

l_wsdl_url VARCHAR2(1024);

l_service_name VARCHAR2(200);

l_operation_name VARCHAR2(200);

l_input_params sys.UTL_DBWS.anydata_list;

l_xmltype_in SYS.XMLTYPE;

l_xmltype_out SYS.XMLTYPE;

BEGIN

l_wsdl_url := '';(这里一定要加?wsdl)

l_service_name := 'servicesService';(就是我们*.asmx的那个类名)

l_operation_name := 'sendMessage';(就是我们具有WebMothed属性的方法名)

l_service := sys.UTL_DBWS.create_service(wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),

service_name => l_service_name);

l_call := sys.UTL_DBWS.create_call(service_handle => l_service,

port_name => NULL,

operation_name => l_operation_name);

l_input_params(1) := ANYDATA.ConvertVarchar2(content);

l_input_params(2) := ANYDATA.ConvertVarchar2(cellNumber);

l_input_params(3) := ANYDATA.ConvertVarchar2(sender);

l_result := sys.UTL_DBWS.invoke(call_handle => l_call,

input_params => l_input_params);

sys.UTL_DBWS.release_call(call_handle => l_call);

sys.UTL_DBWS.release_service(service_handle => l_service);

RETURN ANYDATA.AccessVarchar2(l_result);

EXCEPTION

WHEN OTHERS THEN

RETURN substr(sqlerrm, 0, 2000);

END FUNC_GENERATE_LOGINNAME;

标签: #oracleutl_http