In this section, you will create a WSDL to define the
Customer service.
Procedure
-
In the
Integration
perspective of Talend Studio,
right-click the Services node in the Repository
tree view, and select Create Service from the contextual
menu.
-
In the pop-up wizard, enter the
name CustomerService, the purpose demo and a
description of the service, and then click Next.
Warning: If you are working on a Git-managed project, do not use any of the following reserved key words to name your Service or Service folder:
- tests
- target
- src
-
Select the Create new WSDL option,
and then click Finish.
The service opens in the design workspace with a basic WSDL skeleton, which contains one service, one binding and one port type of one operation.
-
Click the arrow icon to the right
of the input element, CustomerServiceOperationRequest in the
WSDL skeleton. The schema editor opens, allowing you to
define the schema of the request message.
-
Right-click the in element
and select Show
properties in the context menu. In the
Properties view, change its name to
id in the Name field, as in this
use case, the request message will be the customer id. Click
the
icon in the menu bar of the Talend Studio to save the schema and close it.
-
In the WSDL skeleton, click the
arrow icon to the right of the output element, CustomerServiceOperationResponse in the
WSDL skeleton to edit the schema of the response message in
the schema editor.
-
In this use case, there will be
two rows, email and phone of the customer in the response
message. Click the out element and change its name to
Phone in the Properties view.
-
In the design workspace,
right-click the Phone element and select the Insert
Element > After in the context
menu. Give the name Email to it in the Properties
view. Click the
icon in the menu bar of the Talend Studio to save the schema and close it.
- Save the WSDL file. It will be used to build the Web service.
Results
The newly defined Web service with exclamation icon is then shown under the Services node of the Repository view. The exclamation icon means that this defined Web service is not yet used.