XML document cannot be transformed into ASN.1 DER-encoded data
If the XML file has incorrect content, for example, malformed XML or an XML document that does not fit to the ASN.1 specification, the ASN1Encode operator sends a tuple to the error port. The tuple can contain an error code, detailed or additional information, and the XML document that produces the problem.
For example:
{msg=violatedConstraint,info="IA5String: constraint failed (src/operator/EncodeXML/Encoder/Person.c:54)",snippet="<Person>\n\t<!-- spaces are not allowed in the family name -->\n\t<familyName>von Kent</familyName>\n\t<firstName>Clark</firstName>\n\t<gender>1</gender>\n</Person>",filename="01_data.xml"}
If you follow all the rules that are described in the context of the ASN1Encode operator, but your XML document cannot be translated, you can try to debug the ASN1Encode operator. Set the debugDecoder parameter to true, for example:
(
stream<rstring pdu, blob data, rstring filename> Records as O;
stream<ASN1EncodeTypes.ErrorCode msg, rstring info, rstring snippet, rstring filename> Errors as E
) as Encoder = com.teracloud.streams.teda.encoder.binary::ASN1Encode(Payloads as I)
{
param
structureDocument: "etc/grammar.asn";
debugDecoder: true;
output
O: pdu=PDU(), data=Data();
E: msg = ErrorCode(), info = Info(), snippet = Snippet();
}
If the debugDecoder parameter is set to true, the operator prints very detailed trace information to the standard output. Get the job logs to investigate the problem.