Configure REST web service consumer transformation to send and receive data in XML format
Configure REST web service consumer transformation: XML
In this example, Google Maps API has been used to demonstrate REST web service consumer functionality via Http GET method.
Google Maps Directions REST API:
The Google Maps Directions API is a service that calculates directions between locations. The user can search for directions for several modes of transportation, including transit, driving, walking, or cycling. Below call, will provide the steps of driving mode. It provides output in XML format.
Output:
The below screenshot shows the REST XML API, giving the response in XML format when accessed via a browser.
REST web service consumer transformation:
The steps to configure a REST web service consumer transformation in Developer tool to send and receive data in XML format using Http Get method are as below:- Access the given URL (locations used in this example: Informatica, Bagmane Tech Park, and Bangalore Airport) and save the XML file (Right click on the page and save the text content in an XML file).
- Launch Developer tool and create a mapping, add a source having these locations or use an Expression transformation with two output port having the values 'Informatica, Bagmane Tech Park' and 'Bangalore Airport'.
- Create a schema object using the XML file saved in step 1.
- Add a REST web service consumer transformation using HTTP 'GET' method and use the above schema object.
- By default, some ports are already mapped as the output ports. A user can map more output ports as per business requirement. Select the required output ports, map them by dragging and dropping them to Port section. You could also select 'show as hierarchy' to view the ports in the hierarchy.
- Once the transformation is created, you can increase the port precision and add an argument port, right click on the RequestInput > New > Argument port and specify the port name and Argument name as origin and destination(case sensitive).
- Connect output ports from Expression transformation to this Argument ports of REST consumer transformation. Edit the advanced property, add URL as https://maps.googleapis.com/maps/api/directions/xml and Input, output format as XML.
- Run the Data viewer on REST web service consumer transformation to see the result. The result will have multiple groups based on the ports connected to the output as per step #5. You can view the complete 'HTTP Response Body' in XML format in the mapping run log.
- You can watch all steps in Youtube Video link. (in progress)
Hi Kiran ,
ReplyDeleteCan you please let me know how to publish or deploy mapping created using Informatica developer?
Thanks,
Ashok
If you can import mapping in Informatica developer using the same version. Different version support is not available. You can not migrate PC mapping into Informatica developer. This is what your are asking.
DeleteHi, we are trying to use Rest API with Token authentication but unable to resolve special characters. hasn't anyone encounter this issue and were you able to resolve it?
ReplyDeleteThank you for you help in advance.
I think Informatica and its related aspects should actually be very judiciously utilised since it provides a lot of scope for solving many complicated problems.
ReplyDeleteInformatica Read Rest API