Table of Contents

Search

  1. Preface
  2. Web Services
  3. SOAP Web Services
  4. WSDL Data Object
  5. Schema Object
  6. How to Create a SOAP Web Service
  7. Operation Mappings
  8. Parsing Web Service SOAP Messages
  9. Generating Web Service SOAP Messages
  10. Web Service Consumer Transformation
  11. REST Web Services
  12. How to Create a REST Web Service
  13. REST Web Service Consumer Transformation
  14. REST and SOAP Web Service Administration
  15. Datatype Compatibility

Web Services Guide

Web Services Guide

Response Message Formats

Response Message Formats

You can configure a REST web service to return a response message in JSON or XML format.
In the response messages, the C_CUSTKEY field is the resource key. The C_CUSTKEY field contains the key value and the URL to that an application can use to access the customer by the specific key in the output data.
In the JSON format, the URL, the backslash is unicode encoded as
\u002f
.
The resource key value in the URL might also contain encoded values due to the following reasons:
  • The key value contains a URL address such as http://www.informatica.com.
  • The key value contains a percent sign (%) such as 20%.
  • They key value contains a space.
The following text is a response message in JSON format:
{"CUSTOMERS": {"CUSTOMER": [ { "C_ACCTBAL": 9331.13, "C_ADDRESS": "IXRSpVWWZraKII", "C_COMMENT": "Good customer", "C_CUSTKEY": { "@url": "http:\u002F\u002FHostName:8095\u002FDataIntegrationService\u002Simple_Web_Service\u002FRsrc_CUSTOMER\u002FCUSTOMER\u002F63", "$": 63 }, "C_MKTSEGMENT": "AUTOMOBILE", "C_NAME": "Customer#000000063", "C_NATIONKEY": 21, "C_PHONE": "31-952-552-9584" } ]}}
The following text is a response message in XML format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <tns:CUSTOMER xmlns:tns="http:////www.informatica.com"> <tns:C_CUSTKEY url="Simple_Web_Service/CUSTOMER/63">63</tns:C_CUSTKEY> <tns:C_NAME>Customer#000000063 </tns:C_NAME> <tns:C_ADDRESS>IXRSpVWWZraKII </tns:C_ADDRESS> <tns:C_NATIONKEY>21</tns:C_NATIONKEY> <tns:C_PHONE>31-952-552-9584</tns:C_PHONE> <tns:C_ACCTBAL>9331.13</tns:C_ACCTBAL> <tns:C_MKTSEGMENT>AUTOMOBILE</tns:C_MKTSEGMENT> <tns:C_COMMENT>Good customer </tns:C_COMMENT> </tns:CUSTOMER>
You can set the format for the response message. Change the response message format on the
Advanced
tab of the resource mapping
Properties
view. Select JSON or XML for the
Format Type
.
The following image shows the
Advanced
tab of the resource mapping
Properties
view:
The image shows a simple mapping with a Customer Read transformation and an Output output transformation. The Advanced tab of the mapping Properties has a property called Format Type. The value column contains JSON.