NonStop SOAP User's Manual

NonStop SOAP Features and Functions
NonStop SOAP User’s Manual520501-012
4-50
Restricting String Length in WSDL Documents
Restricting String Length in WSDL Documents
Currently, a DDL field defined as pic X(50) gets mapped to a schema data type
xsd:string. To pass this field (of a maximum length of 50), this feature puts a restriction
on the data type, limiting it to a length no greater than that accepted by the DDL field.
Example 4-37 shows the current and new length-restricted schemas generation for this
DDL definition:
?DICT
DEF emp-details.
02 emp-num PIC 9999.
02 emp-name PIC X (50).
END.
The restriction on the length of the string is applied for all DDL data types that can be
defined with a variable length and map to a string schema type.
Example 4-37. Example of String Length Restriction
Current Schema Type New (length-restricted Schema Type)
<xsd:complexType name= “emp_details”>
<xsd:sequence>
<xsd:element name=”emp_num
type=”xsd:long”
minOccurs=”1
maxOccurs=”1”/>
<xsd:element name =”emp_name”
type=”xsd:string”
minOccurs=”1
maxOccurs=”1”/>
<xsd:sequence>
<xsd:complexType>
<xsd:complexType name=”emp_details”>
<xsd:sequence>
<xsd:element name=”emp_num”
type=”xsd:long”
minOccurs=”1”
maxOccurs=”1”/>
<xsd:element name =”emp_name”
minOccurs=”1”
maxOccurs=”1”>
<xsd:simpleType>
<xsd:restriction base=”xsd:string”>
<xsd:maxlength value=”50”/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>