RE: Oracle 10g and web services

  • From: "Christian Antognini" <Christian.Antognini@xxxxxxxxxxxx>
  • To: <ddavey@xxxxxxxxxx>
  • Date: Thu, 17 Mar 2005 21:36:43 +0100

Hi Alan

>Can anyone point me to some examples that use package UTL_DBWS which
>allows pl/sql to consume web services?  The FM lists the API, but no
>examples.  To be quite frank, I don't have time for trial and error
>coding to get the parameters and sequence of procedure/function calls
>correct.  A search of google and OTN isn't returning any examples.
>
>Any examples or links would be greatly appreciated.

I spent some days try it... the conclusion is that this feature is =
simply not ready!

Here an excerpt of some slides I wrote for our New Feature 10g course:

1) Installation of UTL_DBWS

- Even patch 10.1.0.3.0 does not provide working software
  . Library utl_dbws_jserver.jar (bug 3463875)
  . Package UTL_DBWS (bug 3481973)
  . Download and install the "Database Webservices Callout
    Utilities" (last version dated 19-May-2004) from =
http://www.oracle.com/technology/sample_code/tech/java/jsp/dbwebservices.=
html
- Per default execute privilege is granted to PUBLIC but no
  public synonym for UTL_DBWS is created

2) UTL_DBWS and WSDL

- UTL_DBWS should be able to use a WSDL as well,=20
  unfortunately it's not the case yet

- Quote OSS
  "The WSDL_DOCUMENT_LOCATION should specify the WSDL file
  HTTP location and with that location, the DII APIs should
  be able to figure out information such as parameter types,
  instead of requiring us to specify them. Unfortunately,
  some of those intelligent capabilities are currently broken.
  As of now, we still have to specify parameter and return
  type. This is being worked upon and will be fixed in a
  future release ."

3) Working example

DECLARE
  l_wsdl_address httpuritype;
  l_service_name utl_dbws.qname;
  l_service utl_dbws.service;
  l_port_name utl_dbws.qname;
  l_operation_name utl_dbws.qname;
  l_call utl_dbws.call;
  l_endpoint_address utl_dbws.qname;
  l_string_type utl_dbws.qname;
  l_params utl_dbws.anydata_list;
  l_ret anydata;
BEGIN
  -- create service
  l_service_name :=3D utl_dbws.to_qname(null, 'SayHelloService');
  l_service :=3D utl_dbws.create_service(l_service_name);
  -- create call
  l_port_name :=3D utl_dbws.to_qname(null, 'SayHelloRPC');
  l_operation_name :=3D utl_dbws.to_qname(null, 'sayHello');
  l_call :=3D utl_dbws.create_call(l_service, l_port_name, =
l_operation_name);
  -- set endpoint
  l_endpoint_address :=3D =
'http://pandora.ttc.trivadis.com:5620/sayhello/services/SayHelloRPC';
  utl_dbws.set_target_endpoint_address(l_call, l_endpoint_address);
  -- set properties
  utl_dbws.set_property(l_call, 'ENCODINGSTYLE_URI', =
'http://schemas.xmlsoap.org/soap/encoding/');
  utl_dbws.set_property(l_call, 'OPERATION_STYLE', 'rpc');
  -- set type of input and output parameters
  l_string_type :=3D utl_dbws.to_qname('NSURI_SCHEMA_XSD', 'string');
  utl_dbws.add_parameter(l_call, 'name', l_string_type, =
'ParameterMode.IN');
  utl_dbws.set_return_type(l_call, l_string_type);
  -- call
  l_params(0) :=3D anydata.convertvarchar('Chris');
  l_ret :=3D utl_dbws.invoke(l_call, l_params);
  dbms_output.put_line(l_ret.accessvarchar2);
  -- release call
  utl_dbws.release_call(l_call);
  -- release service
  utl_dbws.release_service(l_service);
END;


HTH
Chris
--
//www.freelists.org/webpage/oracle-l

Other related posts: