Microservices in Mulesoft
December 11, 2020CPQ (Configure, Pricing, Quote) In Salesforce
January 21, 2021Extracting CDATA as an Attribute Value From Adaptive Insights :
When we are extracting the CDATA is an attribute value from Adaptive Insights using REST connector in IICS, Sometimes we may end up with below error or with no data in the target system.
<response success=” false”
<messages>
<message key=”invalid-credentials”>M(DISPLAY TRUNCATED)”
When we use an Informatica swagger generator to generate the swagger file to build the rest connector. The connector may not work properly as it handles the request and response in a different manner compared to the Adaptive acceptable format so resulting in the above error.
Challenges to User/Developer
- Creating swagger file properly based on the requirement.
- Adding “XML”: {“attribute”: true} in swagger file.
Solution
- Create a swagger file with the request body using the Informatica swagger generator on the administrator page.
- Modify the below code in the swagger file.
“responses”: {
“200”: {
“description”: “successful operation”,
“schema”: {
“$ref”: “#/definitions/Id”
}
}
}
- To below code.
“responses”: {
“200”: {
“description”: “successful operation”,
“schema”: {
“$ref”: “#/definitions/Id##response”
}
}
}
- For each and every request parameter in swagger, the file adds an “XML” tag. As shown below.
- Modify the below code in swagger file,
“Id_Request##body##call##credentials” : {
“properties” : {
“login” : {
“type” : “string”
},
“password” : {
“type” : “string”
},
“instanceCode” : {
“type” : “string”
}
}
}
- With Below code,
“Id_Request##body##call##credentials”: {
“properties”: {
“login”: {
“type”: “string”,
“xml”: {
“attribute”: true
}
},
“password”: {
“type”: “string”,
“xml”: {
“attribute”: true
}
},
“instanceCode”: {
“type”: “string”,
“xml”: {
“attribute”: true
}
}
}
}
Once you made changes to the swagger file crated a brand new REST connection with the updated swagger file.
- Use this connection in source or in midstream transformation.
- When you use REST connector in source transformation. Under the Source tab, in the request option provide the request body.
- When you use REST connector in midstream transformation. Create a business service with REST connector and use it in Web Service transformation. And provide the values from source transformation.
Conclusion
CDATA as an element in both request and response in Informatica Cloud is not supported currently. In our case, CDATA is an attribute value, so it is supported which was verified and confirmed by the B2B team. Hence using the above workaround, we can extract the CDATA as an attribute value from adaptive insights using REST connector.