Changing Web service implementation
Change Web service Implementation
You have figured out how to integrate consuming applications via web services, now you can work with Denodo to populate the services with data. Our goal now is to create a derived views and add it as the implementation of our i_client_info interface.
Creating derived views
You already know how to create derived views using the available operations (selection, union, join, flatten, minus, intersect). This topic was covered in the Basics Tutorial / DV First Steps / Simple Derived Views using the Web Design tool. Hence, in this tutorial, you will create this derived view in the Web Design Studio.
The derived view we want now must have fields that correspond to the definition of the interface. In our i_client_info interface, the schema is:

This schema is very similar to the schema of the client_with_bills view, let's reuse it!
- i_client_info field: corresponding client_with_bills field(s).
- client_id: this field matches exactly with the client_with_bills view.
- full_name: you don't have this field in any of your views, but we can concatenate the name and surname fields of client_with_bills in order to get the full name.
- client_type: this field matches exactly.
- full_address: just like the full_name field, we will just concatenate street, city, zip and state.
- phone: this field matches primary_phone.
- billing_due_date: this field matches due_date.
- balance: this field matches exactly.
Since we only need one view, to create the new derived view you should use the selection operation to model the proper schema. You can follow these steps:
- Right-click the client_with_bills view in the elements tree and select
New > Selection
. - Go to the Output tab and rename the view to: client_info_impl.
- Remove the fields: name, surname, code, value, street, city, zip, state,
ssn, billing_end_date, phone_center, billing_period_id, billing_start_date, billing_id,
return_customer_id, package_id, amount_due and tax_id
(Keep only client_id, client_type, primary phone, due_date, and balance).
- Rename primary_phone to phone.
- Rename due_date to billing_due_date and edit this field to convert it to date.
- Open the edit dialog by clicking the small pencil next to billing_due_date or right-clicking the field and selecting edit.
- Under Field expression, write to_localdate('yyyy-MM-dd HH:mm:ss', client_with_bills.due_date) (this calls the to_date function which will convert the text data of due_date into the date data type with format 'yyyy-MM-dd HH:mm:ss').
- Click Ok
- Create a new text field called full_name by concatenating name and surname.
- Click the New field button at the bottom of the output dialog.
- Enter the Field name full_name.
- In Field expression, write concat(client_with_bills.name, ' ', client_with_bills.surname) (this calls the concat function which joins the name and surname with a space in-between).
- Click Ok.
- Create a new field called full_address by concatenating street, city, zip and state.
- Click the New field button at the bottom of the output dialog.
- Enter the Field name full_address.
- In Field expression, write concat(client_with_bills.street, ', ', client_with_bills.city, ', ', client_with_bills.zip, ', ', client_with_bills.state) (this calls the concat function which joins each row's street, city, zip, and state with a comma and space in-between each).
- Click Ok.
- Change the type of the balance field from text to decimal.
- Open the edit dialog of the balance field
- Type cast('decimal', client_with_bills.balance) in the Field expression (If possible, this will convert the text of the field into a decimal data type).
- Click Ok.
- Finally, click the
button to create the view.
Configuring interface implementation
The last step of this tutorial is to configure the i_client_info interface to use client_info_impl as its implementation view. Open i_client_info in the interface in the workspace by double-clicking on it and then open the Edit dialog with the button at the top.
Here, open the Implementation tab and all you have to do is drag the implementation view we just created into the dialog:

As you can see, Denodo associates fields with matching names automatically.
We're all set, click the button to add the implementation your interface.
Sweet, your work is done! Well, almost, there's only one last step. Let's test our services (the same steps covered in the Invocation Section) to see the implementation we just setup be queried.
Test the REST data service using these URLs again:
- http://127.0.0.1:9090/server/tutorial/customer/views/i_client_info -> now actually returns all client data.
- http://127.0.0.1:9090/server/tutorial/customer/views/i_client_info?client_id=C005 -> now actualy returns the data for the client whose client_id equals 'C005'.

Test the SOAP data service using SOAPui with the same request as before:

Pretty awesome, huh? Congratulations! You just finished the Denodo Data Services Tutorial set.
Thank you!