Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/DBWS/Creating EclipseLink DBWS Services (ELUG)"
Line 38: | Line 38: | ||
<br /> | <br /> | ||
</onlyinclude> | </onlyinclude> | ||
− | {| class="RuleFormalWideMax" dir="ltr" title="EclipseLink | + | {| class="RuleFormalWideMax" dir="ltr" title="<b>EclipseLink DBWS <code>.war</code> File Contents</b>" width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
+ | |+ <b>EclipseLink DBWS <code>.war</code> File Contents</b> | ||
! id="r1c1-t2" align="left" valign="bottom" | '''File''' | ! id="r1c1-t2" align="left" valign="bottom" | '''File''' | ||
! id="r1c2-t2" align="left" valign="bottom" | '''Description''' | ! id="r1c2-t2" align="left" valign="bottom" | '''Description''' | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
− | | align="left" | | + | | align="left" |
− | swaref.xsd | + | | web.xml | The Web application deployment file that binds the EclipseLink database Web service to Web services stack servlet. | |
− | | | + | | swaref.xsd | Contains XML type definitions for attachments. The name and content of this file is determined by its role in Web deployment and cannot be changed. | |
− | Contains XML type definitions for attachments. The name and content of this file is determined by its role in Web deployment and cannot be changed. | + | | eclipselink-dbws-schema.xsd | Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive |
− | | | + | element-tag names and types. For more information, see [[EclipseLink dbws-builder.xml File (ELUG)#eclipselink-dbws-schema.xsd|eclipselink-dbws-schema.xsd]]. | |
− | | | + | | eclipselink-dbws.xml | The EclipseLink database Web services configuration file. For more information, see [[EclipseLink dbws-builder.xml File (ELUG)#eclipselink-dbws.xml File|eclipselink-dbws.xml File]]. | |
− | eclipselink-dbws-schema.xsd | + | | eclipselink-dbws-sessions .xml |The EclipseLink sessions.xml file for this EclipseLink database Web service. It contains references to the EclipseLink relational and object-XML project.xml files. For more information, see [[Introduction to EclipseLink Sessions (ELUG)]]. | |
− | | | + | | eclipselink-dbws-or.xml |The EclipseLink ORM '''Project''' file. For more information, see [[Introduction to Relational Projects (ELUG)]].| |
− | Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive | + | | eclipselink-dbws-ox.xml |The EclipseLink OXM '''Project''' file. For more information, see [[Introduction to XML Projects (ELUG)]]. | |
− | element-tag names and types. For more information, see [[EclipseLink dbws-builder.xml File (ELUG)#eclipselink-dbws-schema.xsd|eclipselink-dbws-schema.xsd]]. | + | | eclipselink-dbws.wsdl |Contains equivalent entries for each operation for the specified EclipseLink database Web service. Required for deployment as a Web service.|} |
− | | | + | |
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | eclipselink-dbws.xml | + | |
− | | | + | |
− | The EclipseLink database Web services configuration file. For more information, see [[EclipseLink dbws-builder.xml File (ELUG)#eclipselink-dbws.xml File|eclipselink-dbws.xml File]]. | + | |
− | | | + | |
− | | | + | |
− | eclipselink-dbws-sessions .xml | + | |
− | | | + | |
− | The EclipseLink sessions.xml file for this EclipseLink database Web service. It contains references to the EclipseLink relational and object-XML project.xml files. For more information, see [[Introduction to EclipseLink Sessions (ELUG)]]. | + | |
− | | | + | |
− | | | + | |
− | eclipselink-dbws-or.xml | + | |
− | |The EclipseLink | + | |
− | | | + | |
− | | | + | |
− | eclipselink-dbws-ox.xml | + | |
− | |The EclipseLink | + | |
− | | | + | |
− | | | + | |
− | eclipselink-dbws.wsdl | + | |
− | |Contains equivalent entries for each operation for the specified EclipseLink database Web service. Required for deployment as a Web service. | + | |
− | |} | + | |
− | + | ||
This section describes the following: | This section describes the following: |
Revision as of 10:01, 2 April 2009
Note: A basic overview of EclipseLink Database Web Services (DBWS) can be found here
Contents
Creating Deployable EclipseLink DBWS Services
This section describes how to automatically generate a .war file containing the EclipseLink DBWS service descriptor along with all required deployment artifacts for a JAX-WS 2.0 Web service (WSDL, XML schema, web.xml, EclipseLink ORM and OXM native Project XML files, etc.)
root of war file \---web-inf | | web.xml | +---classes | +---foo -- optional domain classes (typically not required) | | \---bar | | Address.class | | Employee.class | | PhoneNumber.class | | | +---META-INF | | eclipselink-dbws.xml | | eclipselink-dbws-or.xml | | eclipselink-dbws-ox.xml | | eclipselink-dbws-sessions.xml -- name can be overridden by <sessions-file> entry in eclipselink-dbws.xml | | | \---_dbws | DBWSProvider.class -- auto-generated JAX-WS 2.0 Provider stub | \---wsdl eclipselink-dbws-schema.xsd eclipselink-dbws.wsdl swaref.xsd -- optional to handle attachments
NB - the files swaref.xsd and web.xml have names and content determined by their roles in web deployment and cannot be changed.
The deployable .war file has been verified to work with the WebLogic 10.3 JavaEE container. An alternate deployable .jar file has been
verified to work as a JavaSE 6 'container-less' EndPoint.
File | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
align="left" | The Web application deployment file that binds the EclipseLink database Web service to Web services stack servlet. | | Contains XML type definitions for attachments. The name and content of this file is determined by its role in Web deployment and cannot be changed. | | Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive
element-tag names and types. For more information, see eclipselink-dbws-schema.xsd. | |
The EclipseLink database Web services configuration file. For more information, see eclipselink-dbws.xml File. | | The EclipseLink sessions.xml file for this EclipseLink database Web service. It contains references to the EclipseLink relational and object-XML project.xml files. For more information, see Introduction to EclipseLink Sessions (ELUG). | | The EclipseLink ORM Project file. For more information, see Introduction to Relational Projects (ELUG).| | The EclipseLink OXM Project file. For more information, see Introduction to XML Projects (ELUG). | | Contains equivalent entries for each operation for the specified EclipseLink database Web service. Required for deployment as a Web service.|}
This section describes the following:
How to Create EclipseLink DBWS Services Using the DBWSBuilder utilityYou can use the EclipseLink DBWS design-time tool DBWSBuilder to create deployment files. DBWSBuilder is a Java application that processes the operations described in an EclipseLink DBWS builder XML file to produce all the required deployment artifacts. Be sure to set the following environment variables in the <ECLIPSELINK_HOME>\utils\dbws\setenv.cmd (or setenv.sh file) before invoking DBWSBuilder:
There are script files provided for invoking DBWSBuilder. They are located in <ECLIPSELINK_HOME>\utils\dbws. The scripts are dbwsbuilder.cmd for Windows usage and dbwsbuilder.sh for other operating systems. DBWSBuilder usage - [] indicates optional argument: prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs[:archive_flag] {packager} [additional args] Available packagers: -packageAs:[default=archive] javase [jarFilename] -packageAs:[default=archive] wls [warFilename] Using DBWSBuilder, you can generate an EclipseLink DBWS service from the following sources:
Using the DBWSBuilder utility to create an EclipseLink DBWS Service from a Database TableCreate an EclipseLink DBWS builder XML File with a <table> query operation: <?xml version="1.0" encoding="UTF-8"?> <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <properties> <property name="projectName">table_test</property> <property name="logLevel">fine</property> <property name="username">scott</property> <property name="password">tiger</property> <property name="url">jdbc:oracle:thin:@localhost:1521:ORCL</property> <property name="driver">oracle.jdbc.OracleDriver</property> <property name="dataSource">jdbc/DBWStestDS</property> <property name="platformClassname">org.eclipse.persistence.platform.database.oracle.Oracle11Platform</property> <property name="wsdlLocationURI">http://localhost:7001/table_test/table_test?wsdl</property> </properties> <table schemaPattern="%" tableNamePattern="dbws_crud" /> </dbws-builder> For more information, see whatever. Using the DBWSBuilder utility to create an EclipseLink DBWS Service from a SQL statementCreate an EclipseLink DBWS builder XML File with a <sql> query operation: <?xml version="1.0" encoding="UTF-8"?> <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema" <properties> <property name="projectName">sql_test</property> ... <property name="wsdlLocationURI">http://localhost:7001/sql_test/sql_test?wsdl</property> </properties> <sql name="employeeInfo" simpleXMLFormatTag="employee-info" xmlTag="aggregate-counts"> <text> <![CDATA[select count(*) as "COUNT", max(SAL) as "MAX-Salary" from EMP]]> </text> </sql> </dbws-builder> For more information, see whatever. Using the DBWSBuilder utility to create an EclipseLink DBWS Service from a Stored ProcedureCreate an EclipseLink DBWS builder XML File with a <procedure> query operation: <?xml version="1.0" encoding="UTF-8"?> <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema" <properties> <property name="projectName">procedure_test</property> ... <property name="wsdlLocationURI">http://localhost:7001/procedure_test/procedure_test?wsdl</property> </properties> <procedure returnType="empType" catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO"/> </procedure> </dbws-builder> For more information, see whatever. How to Customize an EclipseLink DBWS ServiceThere are a number use-cases that require an EclipseLink DBWS Service to be customized. The use-cases can be sub-divided into
Simple EclipseLink DBWS CustomizationIntermediate EclipseLink DBWS Customizationwith an EclipseLink SessionCustomizer as follows:
|