Hi All,
I have a requirement to save a following structure as an XML and then read it.
I have set of products and for each product there is a set of attributes.
For this i get the list of products, and then by looping through the products using FOR-EACH, i am getting the attributes using another REST API call.
For this i tried to write the each loop outcome of product to a stage file along with the attribute with APPEND file option as an XML. And outside the loop i tried to read the same.
My final response should look like below.
{
"products": [{
"AccountId":"0.0.0.1 /account 2339334 8",
"ServiceObj": "0.0.0.1 /service/rentals 2779965 0",
"ProductObj": "0.0.0.1 /product 1106943 0",
"RentRate":25,
"SCRate":100,
"FromDate":"14/06/2019",
"ToDate":"14/07/2019",
"ServiceType":"service/rentals",
"serviceprofiles": [{
"Name": "ContractReferenceNumber",
"ValidDateFrom": "14/06/2019",
"ValidDateTo": "14/06/2019",
"Value": "OPReference160"
}]
}]
}
For both i used same XSD and when I run it , i get the below error .(attached is the xsd in the txt format)
type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1",
"title": "Internal Server Error",
"detail": "Internal server error. Please contact oracle support for details.",
"o:errorCode": "500",
"o:errorDetails": [
{
"type": "UnMappedFault:NA",
"instance": "NA",
"title": "Error while translating message to the mentioned format.\nPlease make sure that the file content conforms to the schema.:<Line 40, Column 40>: XML-20109: (Fatal Error) PI with the name 'xml' can occur only in the beginning of the document.",
"o:errorPath": "NA",
"o:errorCode": "NA"
}
So i dont know how to achieve this, if anyone can help me with this, it will be great help. Also attaching my OIC flow