Feedback

  • Contents
 

SOAP Set Element Type

In SOAP, the type of an argument or the return value is specified by the service description and doesn't need to be included in the payload. However, the service may define the type as xsd:anyType, for example for VARIANT types. In this case, the type must be included in the argument. For example, if a type of "double" is specified, an element will look as follows:

<Element xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:type="xsd:double">1234.567</Element>.

The type may be a user defined (complex) type. For example:

<ns1:Order xmlns:ns1="uri:my-order-type"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns1:Order">
<ns1:Product>Watchmacallit</ns1:Product>
<ns1:Quantity>7</ns1:Quantity>
<ns1:Price>19.99</ns1:Price>
</ns1:Order>.

Please refer to http://www.w3.org/TR/xmlschema-0 or http://www.w3.org/TR/xmlschema-2 for details on the XML Schema Data types.

Parameter

Dir

Type

Remarks

Element

IN

Node

Node of an element whose Schema instance type to set

Type

IN

String

XSD type to declare for this element. The argument may either be just the type name or have schema namespace prefix, such as xsd:string. If the type argument does not contain a prefix, xsd will be used.

Type Namespace

IN

String

Optional. Namespace of the type.

Default: http://www.w3.org/2001/XMLSchema

XSI Namespace

IN

String

Optional. XML Schema Instance namespace.

Default:
http://www.w3.org/2001/XMLSchema-instance

XSI Namespace Prefix

IN

String

Optional. Prefix of the schema instance namespace.

Default: xsi

Declare Namespaces in Envelope

IN

Boolean

Checkbox:

False Declares the XSD and XSI namespaces in the element itself.

True Default. Declare the XSD and XSI namespaces in the Envelope element (actually, the document element is used, as this tool may be for other purposes than SOAP).
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.

Exit Paths: Success, Failure