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.

368 <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 />

The cURL command to send the request to the web service should look like this:<br />

curl.exe -d @RankEmployeeSOAP.xml<br />

-H "Content-Type: text/xml"<br />

-H "SOAP-Action:<br />

\"http://www.ibm.com/db2/onCampus/RankEmployee\""<br />

-v<br />

http://localhost:8080/WebServicesSimpleService/services/SimpleService<br />

Note:<br />

Argument used:<br />

-d @<br />

Name of the file <strong>with</strong> the SOAP request message. This also <strong>for</strong>ces cURL to use HTTP POST<br />

<strong>for</strong> the request.<br />

-H<br />

Additional header fields need to be specified <strong>for</strong> the request. The server needs to know the<br />

Content-Type, which is XML and the SOAPAction header, which can be found in the in the<br />

binding section <strong>for</strong> the SOAP endpoint in the WSDL document. Note: The SOAPAction<br />

String needs to be included in double quotes.<br />

-v<br />

The verbose switch to show detailed messages.<br />

<br />

The URL to send the request to. This needs to be the SOAP over HTTP endpoint URL of<br />

your web service. It can be found in the WSDL document or by using the Web Services<br />

Explorer.<br />

The output of the command should look similar to what is shown in Listing E.2:<br />

* About to connect() to localhost port 8080 (#0)<br />

* Trying 127.0.0.1... connected<br />

* Connected to localhost (127.0.0.1) port 8080 (#0)<br />

> POST /WebServicesSimpleService/services/SimpleService HTTP/1.1<br />

> User-Agent: curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 OpenSSL/0.9.8h<br />

libssh2/0.18<br />

> Host: localhost:8080<br />

> Accept: */*<br />

> Content-Type: text/xml<br />

> SOAPAction:"http://www.ibm.com/db2/onCampus/RankEmployee"<br />

> Content-Length: 389<br />

><br />

< HTTP/1.1 200 OK<br />

< Server: Apache-Coyote/1.1<br />

< Content-Type: text/xml;charset=utf-8<br />

< Transfer-Encoding: chunked

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

Saved successfully!

Ooh no, something went wrong!