Skip to main content

Creation of Array Properties

Creation of Array Properties

By default, the SOAP Wizard creates array-type properties in certain scenarios. You can use the Create No Array Properties option to create properties with a different structure if needed.

Specifically, consider a WSDL that includes the following types:

<s:complexType name="Obj">
    <s:sequence>
        <s:element minOccurs="0" name="MyProp" type="test:Array"/>
    </s:sequence>
</s:complexType>
<s:complexType name="Array">
    <s:sequence>
        <s:element maxOccurs="unbounded" minOccurs="0" name="Item" nillable="true" type="test:Item"/>
    </s:sequence>
</s:complexType>
<s:complexType name="Item">
    <s:simpleContent>
        <s:extension base="s:string">
<s:attribute name="Key" type="s:string" use="required"/>
        </s:extension>
    </s:simpleContent>
</s:complexType>

By default, the SOAP Wizard generates the following class:

Class testws.Obj Extends (%RegisteredObject, %XML.Adaptor)
{

Parameter ELEMENTQUALIFIED = 1;

Parameter NAMESPACE = "https://testws.org";

Parameter XMLNAME = "Obj";

Parameter XMLSEQUENCE = 1;

Property MyProp As array Of %String(MAXLEN = "", XMLITEMNAME = "Item", 
XMLKEYNAME = "Key", XMLNAME = "MyProp", XMLPROJECTION = "COLLECTION");

}

If you select Create No Array Properties when you use the SOAP Wizard, the property MyProp in generated Obj class is defined as follows instead:

Property MyProp As list Of testws.Item(XMLITEMNAME = "Item", XMLNAME = "MyProp", XMLPROJECTION = "COLLECTION");

This property refers to the following class, which the SOAP Wizard also generates:

Class testws.Item Extends (%SerialObject, %XML.Adaptor)
{

Parameter ELEMENTQUALIFIED = 1;

Parameter NAMESPACE = "https://testws.org";

Parameter XMLNAME = "Item";

Parameter XMLSEQUENCE = 1;

Property content As %String(MAXLEN = "", XMLNAME = "content", XMLPROJECTION = "CONTENT");

Property Key As %String(MAXLEN = "", XMLNAME = "Key", XMLPROJECTION = "ATTRIBUTE") 
[ Required, SqlFieldName = _Key ];

}
FeedbackOpens in a new tab