我已经使用 ASP.NET 创建了一个 Web 服务。我试图通过 UTL_DBWS 包从 PL/sql 程序访问这个 url。执行后我收到以下错误:
ORA-29532: Java 调用因未捕获的 Java 异常而终止:端口:{http://tempuri.org/}Service1Soap 不包含操作:信封
你们中的任何人都可以告诉我缺少哪些配置步骤。
我真的很感谢你的帮助。
调用 asp.net 服务的 Oracle 程序是:
create or replace procedure check_dbws
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.call;
l_wsdl_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_service_qname UTL_DBWS.qname;
l_port_qname UTL_DBWS.qname;
l_operation_qname UTL_DBWS.qname;
l_xmltype_in SYS.XMLTYPE;
l_xmltype_out SYS.XMLTYPE;
p_fault_node xmltype;
l_return NUMBER;
l_int_type utl_dbws.qname;
l_string_type utl_dbws.QNAME;
BEGIN
l_wsdl_url := 'http://localhost/TestWebService/Service1.asmx?wsdl';
l_namespace := 'http://tempuri.org/';
l_service_qname := UTL_DBWS.to_qname(l_namespace, 'Service1');
l_port_qname := UTL_DBWS.to_qname(l_namespace, 'Service1Soap');
l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'DBConnect');
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
l_call := UTL_DBWS.create_call (
service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname);
utl_dbws.set_property (l_call,'SOAPACTION_USE','TRUE');
utl_dbws.set_property (l_call,'SOAPACTION_URI', 'DBConnect');
utl_dbws.set_property(l_call,'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
utl_dbws.set_property(l_call,'OPERATION_STYLE', 'document');
l_string_type :=utl_dbws.to_qname('http://www.w3.org/2001/xmlschema','String');
utl_dbws.add_parameter(l_call,'Request',l_string_type,'ParameterMode.IN');
utl_dbws.set_return_type(l_call,l_string_type);
l_xmltype_in:=sys.xmltype('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v002="http://tempuri.org/DBConnect">
<soapenv:Header/>
<soapenv:Body>
<DBConnect>
<Name>Test</Name>
<DBConnect>
</soapenv:Body>
</soapenv:Envelope>');
l_xmltype_out := UTL_DBWS.invoke (call_handle => l_call,,request => l_xmltype_in);
p_fault_node := l_xmltype_out.extract('//soap:Fault', 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
if (p_fault_node is not null) then
dbms_output.put_line(p_fault_node.getclobval());
l_return:=2;
elsif l_xmltype_out is not null then
dbms_output.put_line(l_xmltype_out.getclobval());
l_return:=1;
else
dbms_output.put_line('errorin fault'||sqlerrm);
l_return:=0;
end if;
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
dbms_output.put_line(l_result.AccessVarchar2);
END;