The iBatis DAO with Web Services Wizard will generate a Web Service from an iBatis SQL Map. The wizard derives all of the information needed from the iBatis SQL Map to generate the following components to create a Web service:
The wizard will then use the Eclipse Web Tools Platform (WTP) and Apache Axis to generate the server and client classes for the Web service. The generated classes will include code that supports Query Bands via the Teradata Access Session Manager.
If you have not worked through the guide Getting Started with Teradata Plug-in for Eclipse,do so now before you continue. You should use the single download, Eclipse IDE for Java EE Developers for your installed Eclipse. This download includes additional Eclipse packages for Web application development.
An application server must be installed in Eclipse. Open the Web perspective in Eclipse and go to the Servers view. Right click in the view and select the New->Server drop down menu.
Select the Apache Tomcat v6.0 Server in the New Server Wizard.
Install the new Apache Tomcat server if required. Follow all installation instructions from Apache and Eclipse.
Create Teradata Project
The iBatis DAO with Web Services Wizard requires a Teradata Project. First, if you have not worked through the article Create a Teradata Project using the Teradata Plug-in for Eclipse, do so now before you continue. Now, select File->New->Other.. from the top menu bar in Eclipse. Then select the Teradata Wizards->Teradata Project from the pop-up dialog. Enter "EmployeeProject" for the name of your new Project in the Teradata Project Wizard. Once this is done select the Finish button in the Wizard and a Teradata Project will be created.
Create an iBatis SQL Map
The iBatis DAO with Web Services Wizard uses an iBatis SQL Map file to create a DAO and Web service. Create the EmployeeMapping.xml iBatis XML map using the instructions and the examples in the article Create an iBatis SQL Map with Teradata Plug-in for Eclipse.
Once you have created the EmployeeMapping.xml you can launch the iBatis DAO Web Services Wizard by right clicking on the iBatis XML file from the Package Explorer and selecting the "Create a DAO" menu option.
iBatis DAO with Web Services Wizard
The First page of the Wizard defines the new DAO and options to create a Web Service.
Select the following options:
Now hit the Next button
iBatis DAO Methods
The iBatis DAO Methods Wizard Page allows you to select which SQL actions from your iBatis Map file to be used in your Web service. You can change your return type from returning a single result set object to returning a list instead. Once you hit the next button Your DAO and Web Service Definition files will be created.
Web Service Creation
The next page is the standard WTP Web services Wizard. Set your Client to test. Once you hit the Finish button your Stubs and Skeletons will be created for your Web Service. The Implementation stub will be modified to use the new DAO you just created.
The Web Service client will come up ready to use and connected to your Teradata database.
iBatis DAO with Web Services Wizard using an iBatis XML Map has generated all of the components for your Web service application including:
The Friday Night Project articles from the developer exchange describe how each generated component works individually and with each other. It is now up to you to continue to develop your Web service application with the generated code and framework which has been provided to you.
You can try the following if you are having trouble bringing up your web service or test client:
Make sure you installed the following version of JEE Eclipse:
Start your Eclipse clean (See Article below)
If you are getting HTTP Status 404 in your client, try re-making the client by launching the WTP Generate Client Wizard from your WSDL file in (Your Original Teradata Project)/WebContent/wsdl/ directory.
If you are still having problems bringing up your web service or test client, manually clean your workspace server.
C:\(Your Work Space) \.metadata\.plugins\org.eclipse.wst.server.core\publish.xml
C:\(Your Work Space) \.metadata\.plugins\org.eclipse.wst.server.core\publish
C:\(Your Work Space) \.metadata\.plugins\org.eclipse.wst.server.core\tmp0