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 367<br />

Figure E.5 – The generated XML instance document<br />

8. Save the file. It is stored in the XML -> XML documents folder after refreshing your<br />

data development project. When executing the SOAP binding <strong>for</strong> the<br />

RankEmployee operation <strong>with</strong> the Web Services Explorer, you can see that the<br />

generated SOAP request message content looks very similar, since both match<br />

the same XML schema.<br />

Repeat these steps <strong>for</strong> all operations you want to test using cURL.<br />

E.1.2 SOAP over HTTP Binding<br />

The first service binding we look at is SOAP over HTTP. We described how to test this<br />

binding in Chapter 10 using the Web Services Explorer. In this section, we show you how<br />

to re-create what the Web Services Explorer did <strong>for</strong> you be<strong>for</strong>e.<br />

Start by assembling the SOAP request message by creating a new XML file called<br />

RankEmployeeSOAP.xml. Into that file, copy and paste the SOAP request message<br />

from the Source view of the Web Services Explorer (as shown in Listing E.1.)<br />

<br />

<br />

<br />

10004<br />

Excellent<br />

<br />

<br />

<br />

Listing E.1 - The SOAP request message<br />

Start the SOAP binding using the cURL command. To do this, you need to know the SOAP<br />

over HTTP endpoint URL. <strong>Data</strong> web services has the following rules to get to the SOAP<br />

endpoint URL:<br />

http(s)://://services/<br />

For the SimpleService example, the endpoint URL is:<br />

http://server:8080/WebServicesSimpleService/services/SimpleServi<br />

ce

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

Saved successfully!

Ooh no, something went wrong!