16.10.2015 Views

Getting Started with IBM Data Studio for DB2

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix E – Advanced topics <strong>for</strong> developing data web services 385<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

First Name:<br />

<br />

Last Name:<br />

<br />

Phone Number:<br />

<br />

<br />

<br />

<br />

<br />

<br />

Listing E.8 – XSL script to test extension functions<br />

1. Using the steps described in the previous section, create a new XSL file <strong>with</strong> the<br />

nameTestXSLExtensions.xsl and copy the in<strong>for</strong>mation in Figure E8 into that<br />

script.<br />

2. Assign theTestXSLExtensions.xsl to trans<strong>for</strong>m the output message of the<br />

GET_CUSTOMER_NAME operation and re-deploy the web service.<br />

3. Now, you can run theGET_CUSTOMER_NAME operation <strong>with</strong> HTTP GET using a<br />

web browser. A URL to retrieve the in<strong>for</strong>mation <strong>for</strong> a customer <strong>with</strong> the ID 126911<br />

looks similar to this:<br />

http://localhost:8080/WebServicesSimpleService/rest/SimpleService/GET_CUST<br />

OMER_NAME?CUSTOMERID=126911<br />

As you can see in Figure E.16, the response contains some in<strong>for</strong>mation from the HTTP<br />

request – like the request URL, some HTTP request headers, and the result of the<br />

GET_CUSTOMER_NAME operation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!