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.

374 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>IBM</strong> <strong>Data</strong> <strong>Studio</strong> <strong>for</strong> <strong>DB2</strong><br />

output <strong>for</strong>mat is XML by default.<br />

Example (HTTP GET <strong>with</strong> JSON response):<br />

http://localhost:8080/WebServicesSimpleService/rest/SimpleService/RankEmployee?EMPLYE<br />

E_CODE=10004&RANKING=Poor&_outputFormat=JSON<br />

E.2 Simplify access <strong>for</strong> single-row results<br />

You can use the Fetch only single row <strong>for</strong> queries option <strong>for</strong> query operations that you<br />

know will return only a single row to reduce the complexity of the service response data<br />

structure. It simplifies the message response by removing the tag around the single<br />

row result. Since it’s known that the query operation only returns one result row, the data<br />

web services runtime can skip the row delimiter tag in the response.<br />

TheRankEmployee operation <strong>for</strong> example always returns a single row only. To remove<br />

the tag:<br />

1. From the <strong>Data</strong> Project Explorer, right-click the operation in your web service and<br />

select Edit, as shown in Figure E.7.<br />

Figure E.7 – Editing options <strong>for</strong> an operation<br />

2. Select the Fetch only single row <strong>for</strong> queries option and click Finish as shown in<br />

Figure E.8.

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

Saved successfully!

Ooh no, something went wrong!