Web services are being talked about and used everywhere today in Web services red-hot; Of course, there is a small part of the industry hype. Oracle has also always been at the forefront of technology, releasing expansion packs to support pl/sql access to Web Services as early as the 9i, and making the feature more powerful in Oracle 10g versions, which stems from the introduction of the UTL_DBWS package, In fact, it encapsulates the jpublisher, making it possible for Pl/sql developers to invoke Web services with just a few simple APIs. Below I will show you how to invoke Web services through Pl/sql, and the focus of this article is on Pl/sql invoke Web services implementation, and for how to publish Web services, you can refer to one of my other basic articles Build Web Services with oc4j and axis, or other reference materials.
First, let's build a running environment where you have to download and install Oracle Database from Oracle OTN (Enterprise, Standard, personal), but never install the shortcut, because it does not provide SQLJ components and related commands. If you have installed the database, you can skip this step.
Then, you need to download the corresponding version of UTL_DBWS:
Pre 10g:dbws-callout-utility.zip
10g:dbws-callout-utility-10r2.zip
After the download is complete, you need to extract the file into the <oracle_install_dir>/sqlj/lib directory, and we also need to use Loadjava to load the jar files into the SYS schema for all users to use the expansion pack, which commands the following:
<oracle_install_dir>/bin/loadjava-u sys/password-r-v-f-s-grant public-noverify-genmissing <oracle_instal L_dir>/sqlj/lib/dbwsclient.jar
In Oracle's documentation, it is claimed that the 10g is a UTL_DBWS package, but I downloaded the latest Oracle and completely installed, did not find the slightest trace of UTL_DBWS, but also had to copy and execute the Loadjava.
OK, now everything is ready, just write the program test, before the coding test, we assume that you have the "build Web Services with oc4j and axis" article hellows already deployed, and can call the SayHello method normal; Of course, you publish other web Services are equally feasible. Here we will create a function to test the code as follows: