NonStop SOAP User's Manual
NonStop SOAP Features and Functions
NonStop SOAP User’s Manual—520501-012
4-40
Specifying Base64 Encoding
End.
Now, compile the DDL as:
ddl/in < ddl file-name>/
Specifying Base64 Encoding
A SOAP/XML payload might need to carry binary data or certain characters that are
considered invalid by the W3C XML specification and therefore might fail to parse
successfully. To have the binary data or invalid XML characters represented as valid
XML content it has to be transformed or encoded appropriately.
With NonStop SOAP, you can encode binary and invalid XML characters using Base64
encoding. For NonStop SOAP to apply the Base64 encoding against an XML attribute
or element, it has to be flagged in the DDL dictionary using this SOAP DDL comment
tag: @SOAP_BASE64. This comment tag is active only when the
ProcessSoapDDLComments attribute of the Service element in the SDL is set to “yes”.
Base64 encoding was introduced by the MIME (Multipurpose Internet Mail Exchange)
standard (IETF MIME RFC) as a method for transmitting data that was binary in nature
or contained values representing control characters that would have undesired effects
on the transmission. Base64 consists only of 64 encoding characters (A-Z, a-z, 0-9, +,
/) that are a subset of US-ASCII and are considered valid in the XML specification.
The @SOAP_BASE64 comment tag can be present only at a DDL leaf level. If this tag
is present for a group field then it is flagged as an error. The SOAP Admin tool
validates the above when adding/updating a service into the SDR and returns this error
message.
Example 4-26 on page 4-41, Example 4-27 on page 4-41, and Example 4-28 on
page 4-42 show the @SOAP_BASE64 comment tag in the DDL and the corresponding
sample XML message containing the Base64 data and the XML schema
representation with Base64 schema type.
Caution. The DDL should not be compiled with the output_sensitive flag in the command line.
Note. During run time, the requests will be properly validated with the SDR. The contents of
the SDR will be in mixed case even if the EnableOutputSensitive attribute is set to “no” in the
SDL file. During validation, the fields are taken from the SDR and converted to lowercase if the
service has the EnableOutputSensitive attribute set to “no”.
SOAPADMIN ERROR >> Error processing DDL definition
<definition name> for service <service name>. The
"@SOAP_BASE64" DDL comment tag cannot be present at a group
level DDL field <field name>.