Creating a WSDL Document For Type : DATABASE
In this section, you add a WSDL document, to the BPEL Module project and then use the Partner view of the WSDL editor to configure the components of the WSDL document.
To Create a WSDL Document : dbWSDL
1 Expand the project node in the Projects window.
For example, BpelModuleSample
This opens the New WSDL Document wizard.
2 Right-click the project node or Process Files node. Select New —> WSDL Document...
For example, BpelModuleSample
3 Enter the filename in the File Name field.
For example, dbWSDL.wsdl
4 Select Concrete WSDL Document.
Defines the message format and protocol details for a port type. For JDBC Binding Component, this is always a message containing a database operation defined using the JDBC API.
Indicates which binding to use and how to access the database resource. For Database Binding Component, the address element (<jdbc:address>) specifies the JNDI name for the database resource.
5 Choose the Binding — Database from the drop-down list.
The Binding — SOAP is selected and displayed, by default.
6 Choose any one of the following Types from the drop-down list.
- Prepared Statements
- SQL File
7 Choose Type — Table from the drop-down list.
8 Click Next.
9 Select the URL from the drop-down list.
You find the MySQL Database is not configured and is not available in the list.
Note - A broken icon indicates that the database is not connected.
To Select the Database Connection
Before You Begin
See To Create a WSDL Document: dbWSDL to Create the WSDL Document.
1 Select the URL from the drop-down list.
2 Click Next.
3 Select the table from the DataSource and Table Objects.
4 Click > to move the table from Available Tables to Selected Tables.
Click < to remove the table from the list of Selected Tables.
Note - You can select and move one table at a time.
ALL> and <ALL feature is not enabled. This feature will be implemented in future.
5 Click Next.
6 Select Operation Specific Attributes.
7 Click Advanced. Select the required Column name.
You can Insert, Update, Find, and Poll Records.
Note - As the ID is unique, they cannot be unchecked. Hence, these are greyed out.
Note - Based on the requirement, you can check and uncheck the Column names.
a Choose Select All to select all the Column names.
Observe the following:
b Choose Clear All to clear all the Column names.
8 Click OK.
9 Click Next.
10 Enter an appropriate JNDI Resource Name.
11 Click Finish.
- In the Projects window, the IDE adds a dbWSDL.wsdl node under the Process Files node along with the .xsd file.
- The dbWSDL.wsdl file is open in the WSDL editor.
The WSDL editor has three views: Source, WSDL, and Partner.
- The Properties window is open.
Note - If you do not see the Properties window, choose Window —> Properties.
- The Navigator window is open.
To Edit the SQL
1 Double-click the created WSDL Document.
For example, dbWSDL.wsdl
The WSDL Editor is opened.
2 Expand Bindings —> binding PortType=”jdbcPortype”.
For instance, you want to perform a find operation.
3 Select and expand find from the list.
Expand inputFind and click jdbc:input.
4 Select sql from Properties.
Modify the SQL Statement.
5 Click ellipses (...).
This opens the jdbc:input — sql editor.
Make the necessary changes.
For example, select PHONE, STATE, NAME, ZIP, ADDRESSLINE1, ADDRESSLINE2, CREDIT_LIMIT, EMAIL, CUSTOMER_ID, CITY, FAX, DISCOUNT_CODE from CUSTOMER where NAME=? and CUSTOMER_ID=?
6 Click OK.
7 Click the paramOrder from Properties and enter the values.
For example, you want to find for NAME and CUSTOMER_ID. Enter the parameter order of the result.
- In the WSDL view of the WSDL Editor, the WSDL file appears as a tree component or a series of columns.
- The WSDL view has two subviews: tree view and column view. To switch between the subviews, use the buttons in the WSDL Editor toolbar.
- The main nodes in the WSDL view correspond to the major elements in a WSDL file.
- Types: This node enables you to import XML schemas and to add inline schemas.
- Imports: This node enables you to import WSDL files.
- Messages: This node enables you to create, edit, and delete messages.
- Port Types: This node enables you to create, edit, and delete port types.
- Bindings: This node enables you to create, edit, and delete bindings.
- Services: This node enables you to create, edit, and delete services.
- Extensibility Elements: This node enables you to add the following extensibility elements: partner link types, properties, and property aliases.
Some of the nodes in the WSDL view allow you to add extension attributes.
- Right-click the node and choose Add Extension Attribute.
- Specify the name and namespace in the Add Extension Attribute dialog box.
- Specify the value from the Properties window after adding the attribute.
- Right-click the node and choose Remove Attributes to delete the attribute.
- Right-click a node and choose Go To —> Source.
The Source view appears with the cursor positioned at the beginning of the component's block.
In the Source view, the underlying XML source code appears. You can directly edit the XML.
1 The top of the Source Editor has a tab for each open document. Each tab shows the name of the document.
Note - If the document has been modified and has not been saved, then an asterisk (*) appears after the name. You can right-click a tab to access various commands.
2 A toolbar is located at the top of the Source Editor window.
3 Source code displayed in the Source Editor is syntactically colored.
4 The Source Editor status line is located beneath the horizontal scroll bar. To toggle between insert mode and overwrite mode, use the Insert key.
Return to Using the Database Binding Component