I assume you mean in the yaml mapper codec, in which case you can simply quote the keys and this should work:
mapFrom:
- payload.xml: "payload.?xml"
- payload.version: "payload.@version.myField2"
- payload.xmlns_xsd: "payload.@xmlns:xsd"
If you were asking how to declare an event in EPL to handle this response, you don't need to use the exact naming scheme in your event definition. You could have:
event Response {
string xml;
string version;
string xmlns_xsd;
}
And then using the mapper codec map between the two fields like so:
mapFrom:
- payload.xml: "payload.?xml"
- payload.version: "payload.@version.myField2"
- payload.xmlns_xsd: "payload.@xmlns:xsd"
EDIT
So the first thing stopping your event parsing is that your response isn't valid JSON. The line "ArrayOfBusinessTypeAPI {" would need to be ""ArrayOfBusinessTypeAPI": {". You can only use the mapper codec to parse JSON.
The second reason this isn't working is because the content type is set to text/html. Does the JSON codec have filterOnContentType set to true? If so, it won't transform this message.
However, if the JSON is valid and gets processed by the JSON codec, you can correctly map the event like so:
mapFrom:
- payload.id: metadata.requestId
- payload.xml: "payload.?xml"
- payload.version: "payload.xml.@version"
- payload.xsd: "payload.ArrayOfBusinessTypeAPI.@xmlns:xsd"
- payload.xsi: "payload.ArrayOfBusinessTypeAPI.@xmlns:xsi"
- payload.encoding: "payload.xml.@encoding"
Which maps to an event:
event Resp {
dictionary<string, string> xml;
string version;
string xsd;
}