0 Replies Latest reply: Jul 29, 2011 8:41 AM by 878101 RSS

    The problem with utl_dbws

    878101
      Hi.
      Run the script

      declare
      p_wsdl_url varchar2(100) := 'http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx';
      p_service_name varchar2(50) := 'GetCursOnDateXML';
      l_xml_in xmltype;
      l_xml_out xmltype;
      l_str varchar2(32000);
      l_service sys.UTL_DBWS.service;
      l_call sys.UTL_DBWS.call;
      l_wsdl_url VARCHAR2(32767);
      L_SERVICE_QNAME SYS.UTL_DBWS.QNAME;
      l_xmltype_in XMLTYPE;
      l_xmltype_out XMLTYPE;
      begin
      L_WSDL_URL := p_wsdl_url;
      L_SERVICE_QNAME := sys.utl_dbws.to_qname(null, p_service_name);
      L_SERVICE := sys.utl_dbws.create_service(L_SERVICE_QNAME);
      L_CALL := sys.utl_dbws.create_call(L_SERVICE);
      SYS.UTL_DBWS.SET_TARGET_ENDPOINT_ADDRESS(L_CALL, L_WSDL_URL);
      SYS.UTL_DBWS.SET_PROPERTY(L_CALL, 'OPERATION_STYLE', 'document');
      SYS.UTL_DBWS.SET_PROPERTY(L_CALL, 'SOAPACTION_USE', 'TRUE');
      SYS.UTL_DBWS.SET_PROPERTY(L_CALL,
      'SOAPACTION_URI',
      'http://web.cbr.ru/GetCursOnDateXML');
      l_xmltype_in := xmltype(
      '<GetCursOnDateXML xmlns="http://web.cbr.ru/">
      <On_date>' ||
      TO_CHAR(sysdate-2, 'YYYY-MM-DD') ||
      '</On_date>
      </GetCursOnDateXML>'
      );
      l_xmltype_out := sys.utl_dbws.invoke(L_CALL, l_xmltype_in);
      sys.utl_dbws.release_call(L_call);
      -- sys.utl_dbws.release_service(L_SERVICE);
      sys.utl_dbws.release_all_services;
      -- dbms_output.put_line(l_xmltype_out.getclobval());
      end;

      For the first time works well. The second run gives an error

      ORA-29532: Java call terminated by uncaught Java exception: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: null
      ORA-06512: на "SYS.UTL_DBWS", line 404
      ORA-06512: на "SYS.UTL_DBWS", line 401
      ORA-06512: на line 33
      29532. 00000 - "Java call terminated by uncaught Java exception: %s"
      *Cause:    A Java exception or error was signaled and could not be
      resolved by the Java code.
      *Action:   Modify Java code, if this behavior is not intended.

      Any ideas?

      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
      PL/SQL Release 11.2.0.2.0 - Production
      "CORE 11.2.0.2.0 Production"
      TNS for Solaris: Version 11.2.0.2.0 - Production
      NLSRTL Version 11.2.0.2.0 - Production