create or replace function f_updateredis(taskid in varchar2,faultalarmid in varchar2,stepname in varchar2)
return varchar2
AS
l_service sys.utl_dbws.SERVICE;
l_call sys.utl_dbws.call;
l_result sys.ANYDATA;
l_wsdl_url VARCHAR2(2000);
l_sourcewsdl VARCHAR2(2000);
l_service_name VARCHAR2(200);
l_operation_name VARCHAR2(200);
service_qname sys.utl_dbws.QNAME;
port_qname sys.utl_dbws.QNAME;
operation_qname sys.utl_dbws.QNAME;
string_type_qname sys.utl_dbws.QNAME;
retx ANYDATA;
result VARCHAR2(100);
retx_len number;
ipandoprt varchar2(200);
params sys.utl_dbws.ANYDATA_LIST;
BEGIN
--获取tomcat配置的ip和端口
--select inivalue into ipandoprt from T_DRS_SYS_INI where objid='1000';
--
l_wsdl_url:='http://10.234.16.154:8080/TBPWeb/services/PDAUpdateRedis?wsdl';
l_service_name:='UpdateRedisCacheService';
l_operation_name:='updateCache';
service_qname := sys.utl_dbws.to_qname(null, l_service_name);
l_service := sys.utl_dbws.create_service(service_qname);
port_qname := sys.utl_dbws.to_qname(null, 'UpdateRedisCacheServiceHttpPort');
operation_qname := sys.utl_dbws.to_qname('http://webservice.drs.tellhow.com.app', l_operation_name);
l_call := sys.utl_dbws.create_call(l_service, port_qname, operation_qname);
sys.utl_dbws.set_target_endpoint_address(l_call, 'http://'||ipandoprt||'/TBPWeb/services/PDAUpdateRedis');
string_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
sys.utl_dbws.add_parameter(l_call, 'in0', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(l_call, 'in1', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.add_parameter(l_call, 'in2', string_type_qname, 'ParameterMode.IN');
sys.utl_dbws.set_return_type(l_call, string_type_qname);
params(0) := ANYDATA.convertvarchar(taskid);
params(1) := ANYDATA.convertvarchar(faultalarmid);
params(2) := ANYDATA.convertvarchar(stepname);
retx := sys.utl_dbws.invoke(l_call, params);
result := retx.accessvarchar2;
commit;
RETURN result;
EXCEPTION
WHEN OTHERS THEN
RETURN substr(sqlerrm,0,2000);
END f_updateredis;
执行的时候报错:ORA-29540: 类 oracle/jpub/runtime/dbws/DbwsProxy 不存在
求大神帮忙!!
--友情转载