sql/create.sql,
contains a number of methods. Each method will be exposed as a Web Service
operation.
To run this demo you need to ensure that you have installed the required software and set up your environment. In addition, an installation of the Oracle database is required.
SQL> conn scott/tiger
SQL> @create.sql
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:@<host>:<port>:<sid>"
inactivity-timeout="30"
/>
java -jar oc4j.jar
jdbc:oracle:thin:@<host>:<port>:<sid>
antin the current directory. Press the ENTER key to proceed after SQL scripts are executed. If the database used is remote, ignore the "Oracle no available" errors, instead run the suggested SQL script against the database used and then press the ENTER key. The last target "run-client" should give the following result:
[java] Successfully added an employeeThis step accomplish several tasks including assembling, deploying, binding the application and then running the client. In the next section, Step 5a (Alternative to Step 5), we will detail how this step is implemented with separate commands.
[java] TIMESTAMP test done: false
[java] BOOLEAN Test returned true
[java] SW 5Th Ave. Portland OR 97204
[java] Tony Blick 1181000.0
[java] SW 5Th Ave. Portland OR 97204
[java] Holder Test - Get Emp ID: 1000.0, Name: Tony.Blick
[java] Successfully removed an employee
java -jar $ORACLE_HOME/webservices/wsa.jar -config service-config.xmlThis step publishes a PL/SQL package into a Webservices application. The following files will be generated.
SQL>conn scott/tiger
SQL>@Company_plsql_wrapper.sql
java -jar $J2EE_HOME/admin.jar ormi://localhost admin welcome -deploy -file dist/plsql.ear -deploymentName plsql
java -jar $J2EE_HOME/admin.jar ormi://localhost admin welcome -bindWebApp plsql plsql-web http-web-site /plsql
java -jar $ORACLE_HOME/webservices/wsa.jar -config client-config.xml
The client proxy will be generated in the subdirectory build/classes/client.
src/client/oracle/demo/db/plsql/CompanyClient.java, uses the client proxy, generated in Step 5a(5), to invoke the WebServices operations.
Compile and run the client program using the ANT commands:
ant compile-clientThe target "run-client" will give the result described in Section 5.
ant run-client
http://localhost:8888/plsql/plsql
SQL> conn scott/tigerRun the drop.sql script in the sql subdirectory to clean the schema created by the script create.sql.
SQL> @Company_plsql_dropper.sql
SQL> conn scott/tiger
SQL> @drop.sql