资源说明:Example SOAP webservice implemented in scala
h1. Purpose In my day job I write a lot of SOAP webservice using a variety of tools/frameworks/languages. I wrote this as a way to show how easily this can be done in scala. h2. Goals * Functioning SOAP webservice * Interacts with database * 100 LOC (I went a little over) * Show off features of scala language * No libraries/frameworks just core scala code. h1. Installation h2. Install Maven Maven is available bere: http://maven.apache.org/download.html h2. Start jetty webserver on port 9090 Go to the root directory of the project and run: @>mvn jetty:run@ h2. Open UserDetails-soapui-project.xml with SoapUI. SOAP UI is an free soap testing toolkit available here: "http://www.soapui.org/":http://www.soapui.org/l Or the wsdl is served from "http://localhost:9090/UserDetails.wsdl":http://localhost:9090/UserDetails.wsdll h1. Changing Database By default this project uses an embedded HSQL database. HSQL does not require any installation, it also does not preserve data between restarts. The Bootstrap class creates the database tables on startup. Alternatively you can use a Oracle XE database. If you are doing this disable the Bootstrap class by removing it from the web.xml. h4. Install Oracle XE Oracle XE can be downloaded from here "http://www.oracle.com/technology/products/database/xe/index.html":http://www.oracle.com/technology/products/database/xe/index.htmll h4. Create 'test_user' in local oracle database.. h4. Run create-oracle.sql script. This will create the database objects and populate some data Note. this is an oracle specific script, for other RDBMS you will have to modify h4. Install Oracle DB driver into local maven repository Due to licensing issues the Oracle DB driver can not be installed into any public maven repositories If installed Oracle XE is installed on windows driver will be here: C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar Run maven install: @>mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar@ Otherwise you can go here to download it: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html h4. Add oracle driver to classpath. In the pom.xml uncomment the oracle database driver dependency. h4. Change jetty configuration to point to oracle Edit src/main/webapp/WEB-INF/jetty-env.xml Uncomment the oracle datasource to point to a different database/user To use another RDBMS # Change the class name to an appropriate value: class="oracle.jdbc.pool.OracleConnectionPoolDataSource" # Update the jdbc connection string and user/password Modify the pom.xml dependencies to include the JDBC driver jar of your database.
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。