16.10.2015 Views

Getting Started with IBM Data Studio for DB2

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Figure E.15 – Response trans<strong>for</strong>med as HTML<br />

Note:<br />

When looking at the WSDL file you will recognize that<br />

GetBestSellingProductsByMonth is missing in the SOAP binding. This is due to the<br />

fact that now HTML is produced, but a SOAP message needs to be XML.<br />

E.4.2 <strong>Data</strong> web services XSL Extensions<br />

The data web services runtime provides a few XSL extension functions that allow you to<br />

access the request URL, the request HTTP header fields, and set the HTTP response<br />

header fields, shown in Table E.1.<br />

Extension function<br />

getHTTPRequestHeader(header)<br />

getHTTPRequestURL()<br />

getHTTPRequestQueryString()<br />

setHTTPResponseHeader(header,<br />

value)<br />

Description<br />

Returns the value <strong>for</strong> a given HTTP request<br />

header<br />

Returns the request URL<br />

Returns the query string of the URL<br />

Sets the value <strong>for</strong> a given HTTP response<br />

header field<br />

Encodes the string as JSON string – can be<br />

encodeJSON(value)<br />

used to generate custom JSON output<br />

Table E.1 – Available XSL Extension functions

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

Saved successfully!

Ooh no, something went wrong!