- Contents
SOAP API Developer's Guide
SOAP Create Array
Turns an element, for example an RPC parameter, into a SOAP array. The array is created for values supplied as list of strings or just a number of empty elements that can be populated with complex data. The following is a sample array as produced by this tool (default argument):
<Element xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENC:arrayType="xsd:string[5]"
xsi:type="SOAP-ENC:Array">
<xsd:string>first</xsd:string>
<xsd:string>second</xsd:string>
<xsd:string>third</xsd:string>
<xsd:string>fourth</xsd:string>
<xsd:string>fifth</xsd:string>
</Element>
If the element already has child elements, they are all removed before the array elements are added. The array items may be user defined (complex) types. Use the ‘XML Get Next Item' tool to iterate through the 'Item Elements' collection and populate the items. For example:
<Element xmlns:ns1="uri:my-order-type"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENC:arrayType="ns1:Order[3]"
xsi:type="SOAP-ENC:Array">
<ns1:Order>
<ns1:Product>Watchmacallit</ns1:Product>
<ns1:Quantity>3</ns1:Quantity>
<ns1:Price>19.99</ns1:Price>
</ns1:Order>
<ns1:Order>
<ns1:Product>Doodleany</ns1:Product>
<ns1:Quantity>9</ns1:Quantity>
<ns1:Price>12.49</ns1:Price>
</ns1:Order>
<ns1:Order>
<ns1:Product>Ozadingdong</ns1:Product>
<ns1:Quantity>1</ns1:Quantity>
<ns1:Price>43.15</ns1:Price>
</ns1:Order>
</Element>
For details on the XML Schema Data types, refer to http://www.w3.org/TR/xmlschema-0 or http://www.w3.org/TR/xmlschema-2.
Exit Paths: Success, Empty, Failure
Parameter |
Dir |
Type |
Remarks |
Element |
IN |
Node |
Node of the parameter to turn into an array. |
Values |
IN |
StringList |
Optional. List of strings to set as the array items. If not specified, empty elements will be created. |
Size |
IN |
Integer |
Optional. Size of the array. If not specified, the length of the ‘Values' list specifies the size. If both a ‘Values' and ‘Size' argument are given, the ‘Size' has precedent and either not all items of the ‘Values' list are included or the array is padded with elements containing the ‘Default Value'. |
Default Value |
IN |
String |
Optional. Default array item value for padding items (if ‘Size' is larger than size of ‘Values' or no ‘Values' defined). Default: No value (padding elements will be empty) |
Array Type |
IN |
String |
Optional. Type of the array. The argument may either be just the type name or have schema namespace prefix, such as xsd:string. If the type argument does not have a prefix, xsd will be used. Default: xsd:string |
Type Namespace |
IN |
String |
Optional. Namespace of the array type. Default: http://www.w3.org/2001/XMLSchema |
Encoding Prefix |
IN |
String |
Optional. Prefix of the encoding namespace (http://schemas.xmlsoap.org/soap/encoding/). Default: SOAP-ENC |
Item Element Name |
IN |
String |
Optional. Qualified name of the array items. Default: Qualified array type (thus, the default item element name is xsd:string). |
Item Element Namespace |
IN |
String |
Optional. Namespace of the array items. Default: Namespace of the prefix of ‘Item Element Name'. If no prefix, empty namespace. |
XSI Namespace |
IN |
String |
Optional. XML Schema Instance namespace. Default: |
XSI Namespace Prefix |
IN |
String |
Optional. Prefix of the schema instance namespace. Default: xsi |
Include XSI Type Declaration |
IN |
String |
Checkbox: False Do not add a type declaration for the array. True Default. Add XSI type declaration for the SOAP Array.
If all parameters are default the declaration is: |
Declare Namespaces in Envelope |
IN |
Boolean |
Checkbox: False Declares the namespaces in the element itself. True Default. Declare the namespaces in the Envelope element (if they aren't already). If any of the parent elements already has a NS declaration for a prefix and the namespace URI is different, the declaration will be added to the element, and not the Envelope. |
Return Item Element Collection |
IN |
Boolean |
Checkbox: False Does not return collection of array items (‘Array Items' is returned as NULL). True Default. Return collection ‘Array Items' containing all items of the array. |
Item Elements |
OUT |
NodeIter |
Iterator pointing to first element of a collection containing the nodes of the array items. |
Count |
OUT |
Integer |
Number of items in the array. NOTE: this value is returned, even if ‘Return Item Collection' is False. |