HTTP Methods
When you create a REST Web Service Consumer transformation, you select the HTTP method that the Data Integration Service uses in the request message. You cannot change the HTTP method after you create the transformation.
You configure the transformation to use one of the following HTTP methods:
- Get
- Retrieves a resource or a collection of resources from the web service. For example, you can retrieve a table of products or retrieve information about one product.
- Post
- Sends data to a web service. Use the Post method to create a resource or collection of resources. For example, you can add the details of a new store transaction.
- Put
- Replaces a resource or a collection of resources. If the data does not exist, the Put method posts the data. For example, you can update a customer shipping address.
- Delete
- Deletes a resource or a collection of resources. For example, you can delete the record of an employee that no longer works for an organization.
HTTP Get Method
The Data Integration Service uses the HTTP Get method to retrieve data from a REST web service. Use the Get method to retrieve a resource or a collection of resources.
When you configure the REST Web Service Consumer transformation to use the Get method, you configure the input ports, the method output, and the output ports. You do not configure method input.
Example
You want to retrieve the description and price for part number 500 in the HypoStores products database. The web service uses the following URL to identify a part:
http://www.HypoStores.com/products/ProductDetails?Part_No=<Part_No>
Enter the following base URL:
http://www.HypoStores.com/products/ProductDetails
The following table shows the input port that you might define:
Port Type | Argument Name | Input Value |
---|
Argument | Part_No | 500 |
The following table shows the output ports that you might define:
Port Type | Port Name | Return Value |
---|
Output | Part_Desc | …<desc>ACME ball point pens, 12-pk, black, 0.7 mm</desc>… |
Output | Price_USD | …<price>9.89</price>… |
HTTP Post Method
The Data Integration Service uses the HTTP Post method to send data to a REST web service. The web service determines the actual function that the Post method performs. You might use the Post method to create a resource or a collection of resources.
When you configure the REST Web Service Consumer transformation to use the Post method, you configure the input ports, the method input, the method output, and the output ports.
Example
You want to post new part 501 to the HypoStores products database. The web service uses the following URL for part 501:
http://www.HypoStores.com/products/ProductDetails/501
Enter the following base URL:
http://www.HypoStores.com/products/ProductDetails
The following table shows the input ports that you might define:
Port Type | Port Name | Input Value |
---|
URL | URL_Part_No | 501 |
Input | Part_Desc | ACME ball point pens, 12-pk, black, 0.5 mm |
Input | Price_USD | 9.89 |
The following table shows the output ports that you might define:
Port Type | Port Name | Return Value |
---|
Output | Response | <Response returned by the web service> |
HTTP Put Method
The Data Integration Service uses the HTTP Put method to update data through a REST web service. Use the Post method to update a resource or a collection of resources. If the data does not exist, the Data Integration Service creates the resource or collection of resources.
When you configure the REST Web Service Consumer transformation to use the Put method, you configure the input ports, the method input, the method output, and the output ports.
Example
You want to update the unit price for part 501 in the HypoStores products database. The web service uses the following URL for part 501:
http://www.HypoStores.com/products/ProductDetails/501
Enter the following base URL:
http://www.HypoStores.com/products/ProductDetails
The following table shows the input ports that you might define:
Port Type | Port Name | Input Value |
---|
URL | URL_Part_No | 501 |
Input | Price_USD | 9.99 |
The following table shows the output ports that you might define:
Port Type | Port Name | Return Value |
---|
Output | Response | <Response returned by the web service> |
HTTP Delete Method
The Data Integration Service uses the HTTP Delete method to remove data through a REST web service. Use the Delete method to remove a resource or a collection of resources.
When you configure the REST Web Service Consumer transformation to use the Delete method, you configure the input ports, the method input, the method output, and the output ports.
Example
You want to delete part number 502 from the HypoStores products database. The web service uses the following URL to identify a part:
http://www.HypoStores.com/products/ProductDetails?Part_No=<Part_No>
Enter the following base URL:
http://www.HypoStores.com/products/ProductDetails
The following table shows the input port that you might define:
Port Type | Argument Name | Input Value |
---|
Argument | Part_No | 502 |
The following table shows output ports that you might define:
Port Type | Port Name | Return Value |
---|
Output | Response | <Response returned by the web service> |