NonStop SOAP 4.1 User's Manual

Example 14 A Sample DDL file with the @SOAP_BASE64 Tag
?comments
DEF PATIENT.
02 PATIENT-DATA.
03 ID PIC 9(5).
03 AGE PIC 9(3).
03 NAME.
04 FIRST PIC X(20).
04 MIDDLE PIC X.
04 LAST PIC X(25).
* @SOAP_BASE64
03 BINARY-CONTENT type binary 32.
END
In the DDL file, the BINARY-CONTENT field is tagged as @SOAP_BASE64. This is indicated by the
element type xsd:base64Binary in the XML schema present in the WSDL file and the XML
schema file (shown in Example 15), created by the SoapAdminCL tool.
Example 15 An XML Schema for a Sample DDL file with the @SOAP_BASE64 Tag
<xsd:complexType name="name">
<xsd:sequence>
<xsd:element name="first" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="middle" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="last" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="patient_data">
<xsd:sequence>
<xsd:element name="id" type="xsd:long" minOccurs="1" maxOccurs="1"/>
<xsd:element name="age" type="xsd:long" minOccurs="1" maxOccurs="1"/>
<xsd:element name="name" type="tns:name" minOccurs="1" maxOccurs="1"/>
<xsd:element name="binary_content" type="xsd:base64Binary"
minOccurs="1" maxOccurs="1"/>
</xsd:simpleType>
<xsd:restriction base="xsd:base64Binary">
<xsd:maxLength value="4">
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Example 16 is a valid XML representation based on the XML schema shown in Example 15.
Example 16 XML Message for a DDL file with the @SOAP_BASE64 Tag
<patient_data>
<id>12345</id>
<age>55</age>
<name>
<first>John</first>
<middle></middle>
<last>Smith</last>
</name>
<binary_content>m6Lp</binary_content>
</patient_data>
The information passed in the binary_content tag is processed by NonStop SOAP 4 as Base64
Encoded data.
Using the SOAP_OCCURS_DEP_ON DDL Comment Tag
NonStop SOAP 4 allows you to flag a DDL field as SOAP_OCCURS_DEP_ON (occurs depending
on), which declares that a field or a group is repeated a variable number of times depending on
the value of another DDL field.
226 NonStop SOAP 4 Features