Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial will guide you on how to expose data stored in Cassandra as a data serviceAlso, see the samples in Data Integration Samples.

...

...

Finish creating the data service

Once you have defined the operation, click Finish to complete the data service creation process. You will now be taken to the Deployed Services screen, which shows all the data services deployed on the server.

Invoking your data service using SOAP

You can try the data service you created by using the TryIt tool that is in your product by default. 

  1. Go to the Deployed Services screen.
  2. Click the Try this service link for the Cassandra data service. The TryIt Tool will open with the data service.

Create the Keyspace

  1. Select the createKSOp operation you created earlier. 

  2. Click Send.

The UsersKS keyspace is now added to the database.

Create the table in the Keyspace

  1. Select the createTableOp operation you created earlier. 

  2. Click Send.

The Users keyspace is now added to the UsersKS keyspace.

Post new data

  1. Select the addUsersOp operation you created earlier. 
  2. You need to provide the user details. Be sure to enter a UUID value as the user ID.

  3. Click Send.

The data is now added to the database.

Get data

  1. Select the getUsersbyIDop operation you created earlier. 
  2. Click Send to see the details of the user you added previously.

Excerpt
hiddentrue

Invoking your data service using REST

The HTTP requests sent for each of the resources using cURL would be as follows:

Post new data

  1. Create a file called employee-payload.xml file, and define the XML payload for posting new data as shown below.

    Code Block
    <_postemployee>
        <EmployeeNumber>3</EmployeeNumber>
        <FirstName>Will</FirstName>
        <LastName>Smith</LastName>
        <Email>will@google.com</Email>
        <Salary>15500.0</Salary>
    </_postemployee>
  2. Send the following HTTP request from the location where the employee-payload.xml file is stored:

    Code Block
    curl -X POST -H 'Accept: application/xml'  -H 'Content-Type: application/xml' --data "@employee-payload.xml" http://localhost:8280/services/RDBMSDataService/employee

Get data

The service can be invoked in REST-style via curl (http://curl.haxx.se). Shown below is the curl command to invoke the GET resource:

Code Block
curl -X GET http://localhost:8280/services/RDBMSDataService.HTTPEndpoint/Employee/3