Original Message:
Sent: 9/28/2024 9:20:00 PM
From: v k
Subject: RE: api connect map policy error policy=map : Output output: Invalid XML schema encountered
Sorry for the delayed message Steve Linn,below is the code I am using
- operations:
- verb: post
path: /testjsontoxml
execute:
- parse:
version: 2.2.0
title: parse
parse-settings-reference:
parse-settings:
document_type: json
max_doc_size: 900
max_width: 440
max_nesting_depth: 300
max_name_length: 50
max_value_length: 70
input: ''
output: responsemessage
- json-to-xml:
version: 2.0.0
title: json-to-xml
root-element-name: json
always-output-root-element: false
unnamed-element-name: response
input: responsemessage
output: responsemessage
conversionType: relaxed-badgerfish
- map:
version: 2.1.0
title: map
inputs:
input:
schema:
type: object
variable: responsemessage
content: application/xml
outputs:
output:
schema:
type: object
variable: message.body
content: application/xml
actions:
- set: output
from: input
------------------------------
v k
------------------------------
------------------------------
v k
------------------------------
Original Message:
Sent: Fri September 20, 2024 09:06 AM
From: Steve Linn
Subject: api connect map policy error policy=map : Output output: Invalid XML schema encountered
Hi VK,
In my simple test, the json-to-xml policy took input message responseMessage and converted the JSON to XML, writing the XML to the context message responseMessage in place. That should be what you're seeing since you're expecting the map input to be getting XML input from responseMessage.body. The map policy is schema driven for both the inputs and outputs, and when you specify that an input or output is application/xml, the schema will be examined to ensure you have one and only one root element in the schema. The error message is indicating that your schema for the output named output is invalid. What does the map policy and its output schema look like?
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed September 18, 2024 12:54 PM
From: v k
Subject: api connect map policy error policy=map : Output output: Invalid XML schema encountered
I am trying to test jsontoxmlpolicy below are the steps I configured .I just want to parse the inout and save it to an variable. Use that variable in jsontoxml policy save output in a variable.how can I achieve this?
1)parse policy with Message for resulting parsed data mapped to element responseMessage.
2)json-to-xml policy with input configured to responseMessage output is given empty .
3)map policy to map input responseMessage.body to message.body as output.
I am receiving the below error.
"moreInformation": "Map: API=testjsontosoapconversion, policy=map : Output output: Invalid XML schema encountered, multiple elements or no elements: ; cannot be specified at the root document level."
}
------------------------------
vk k
------------------------------