5.2.3 Creation of WSDL file
For creating a WSDL of the X-Road dataservice, you can:
- Take some available WSDL file as basis (for this purpose, sample files of the training environment include the file person_register.wsdl) and edit it according to the needs of your service.
- Create a new WSDL file with Eclipse IDE tools
Creation of a new WSDL with Eclipse wizard is described below.
In order to obtain a WSDL description of X-Road dataservice, we create the frame of a new WSDL file with one minimal service by using the Eclipse wizard for creating the WSDL file. As a result we get an example of a WSDL file, which can be edited as necessary.
For creating a new WSDL in the Eclipse environment, execute the following steps:
- Select: File -> New ->Other -> WSDL File
Select :Next >
Enter data of WSDL file:
File name: persons_register.wsdl (WSDL file name of database)
Select: Next >
Enter the data:
Target namespace: Enter namespace of your dataservice, e.g.: http://persons_register.x-road.ee
SOAP Binding options: select ‘document literal’
Now we have generated the minimum WSDL file, including one WSDL operation ‘NewOperation’ corresponding to the X-Road dataservice.
Then, we will start editing the generated WSDL example to bring it into conformity with our X-Road dataservice.
There are two alternatives in Eclipse WSDL editor for editing WSDL:
1. Edit the WSDL source code directly or work with XML in a text editor and use Eclipse WSDL validator during editing for validating the correctness of XML/WSDL.
2. Edit WSDL in graphic editor, where WSDL/XML source code is generated automatically.