SOAP VERSION 1.2 Chinese Manual 4

zhaozj2021-02-17  67

5. SOAP encoding

The SOAP encoding style is based on a simple type system, and this system is generally in the common characteristics of the type system in the program language, database, and semi-structural data. A type is either a simple (quantified) type or a composite type, which consists of multiple parts, each part of which is a type. There will be a more detailed description below. This section defines a sequencing rule for the order of type of object map. It operates at two levels. First, a mode of the XML syntax layer is constructed by the pattern described by this type of system is given on a symbol. Next, a model of a type system and a representation of a value consistent with this mode are provided, and a mode of an XML instance layer is constructed. Conversely, first provide an example of these rules XML, and then give the original mode, one original value is also constructed.

The namespace identifiers used in the elements and properties defined in this section are "http://www.w3.org/2001/06/soap-encoding". In the examples of these codes, it is assumed that all namespace declarations are at higher elements levels.

The data model and coding style described in this section are encouraged instead of prerequisites, other data models and codes can also be used in combination with SOAP (see section 4.1.1).

5.1 Rule for type encoding using XML

XML allows very flexible encoding data very flexible. SOAP only defines a very limited coding rule. This section defines a coding rule at a high level, and the next section describes the clear type of coding rule that is when there is a more detailed demand. The encodings described in this section can be used in combination with the RPC calls and responses described in Section 7.

To describe the encoding, the following terms will be used:

The "value" value is a string, a metric (number, date, a rose) name, or a combination of a plurality of simple values. All values ​​have a clear type. The Simple Value is a simple value that does not contain any portion that can be named. The simple value of ions can be specific strings, certificates or rose values. "Compound value" composite value is a gathering of a value. Examples of composite values ​​can be specific purchase orders, inventory reports, street addresses, etc. In a composite value, each associated value can be distinguished by a role name, or a number of orders can be used to distinguish between, of course, can be used simultaneously. This is called "Accessor" access ID. The ions of the composite value include a specific purchase order, inventory report, etc. An array is also a composite value. It can be seen as a composite value of an access identity (Accessor) having multiple identical names, such as RDF. "Array" array is a composite value, and there is only a different location between its member values. The "Struct" structure is a composite value, and the distinction between its member values ​​is to rely on access identification (Accessor). At the same time all the names of access identity should be different. The Simple Type is a simple type of simple value. Simple types of examples include those "string", "integer", rose classes, etc. "Compound Type" composite type is a class of composite values. Examples of composite types include an abstract type of purchasing order, which has the same access identifier (Shipto, Totalcost, etc.), of course they have different values ​​(perhaps constraints may be constrained for some values). In a composite type, an access identity is unique in this conformational type, and if it is unable to distinguish between an access identity in other composite types, the access identity name is the name of the composite type to become The only identifier, this name is "local name". Whether the name is directly or indirectly based on a URI, if the access identifier does not have to add type name constraints, then the name is "global name". The information given in the mode of the value list is possible to determine that some values ​​can only be associated with a simple instance of an access identity. For other possible situations, this assertion cannot be disconnected. A value is called "Single-Reference" single reference, if only one access identifier can be referenced. If you can be quoted by multiple references, whether in fact, there is a potential, that is, "multi-reference" more references. Note that there is a certain value in a mode is single to use and others are more references. In syntactics, an element can be "independent" or "embedded". A separate element appears as a top element in order. And others are embedded elements. Although the XSI: Type property can make the value of the value as described herein, that is, the structure of the containing value also contains the type of value, but the type of sequencing rule allows the value of the value can only be defined in the schema (SCHEMA). These modes can be described using the specification defined in "XML Schema Part 1: Structures" [10] and "XML Schema Part 2: DataTypes [11], of course, other mode definitions can also be used. Note that although this, many modes define only the structure (STRUCT) and array (array) types, and the order rules are likely to try the composite type outside of the structure (STRAY) type.

The order rules are as follows:

All values ​​should be expressed as contents. A multi-reference value must be represented as an independent element. And a single reference value should not be said (but can be the case). For each element containing a value, the value of the value indicates that the following at least one of the conditions must be met: (a) Element instance containing this value contains an XSI: Type property, (b) element instance containing this value is included in an ENC : The element of the arraytype property (may be set to default), (c) the name of the element with a type of explicit association, and this type is determined by a mode. A simple value should be expressed as character data, that is, no child elements. Each simple value must have a type, which is either in the DataTypes section [11] of the XML Schema specification, or its source type should be listed in this section (see Section 5.2). A composite value should be encoded as an element sequence, each of which is represented by an embedded element, and their name is one or one. If the name of the access identity is part in the type containing it, it has an unmodified element name, while others should have a fully modified name (see Section 5.4). A simple or composite value of a multi-reference should be encoded as a separate element, which should contain a local "ID" attribute with non-limiting names, which is the ID type defined in XML specification [7]. . Each access identifier for this value is an empty element, which has a local unmodified attribute "href", which is the "URI-REFERENCE" type defined in the XML Schema specification [11], " The value of the HREF "property is a URI clip identifier that references to the corresponding independent element. Strings and byte arrays are represented as multi-reference simple types, but special rules also allow them to represent more efficiently (see Section 5.2.1 and Section 5.2.3). A string or byte array access identifier may have an attribute of an ID type named "ID" in XML specification [7]. If this is, all other access identities for the same value can be encoded as an empty element, which should include a local "href" attribute with a non-limiting name, the type of the attribute is an XML Schema specification [ 11] The "URI-REFERENCE" type defined in the 11th, the value of the "HREF" attribute is a URI clip identifier that references the corresponding independent element. Multiple references to a value encoding are allowed, which seems to be referenced by reference to multiple different values, but only the meaning of the XML instance is not changed only when it is from the context. The array is a composite value (see section 5.4.2). The SOAP array is defined as the type "ENC: Array" or type is from "Enc: Array". The SOAP array has one or more dimension, and its members are distinguished by the order. The value of an array is expressed as a sequence that reflects the elements of the array, and these members appear from small to large order. For multi-dimensional arrays, the element dimension changes from right to left order. No member elements are named a separate element (see Rule 2). The SOAP array can be a single value, or a multi-reference value, so that it can be represented as an embedded element or a separate element. The SOAP array must contain a "ENC: ArrayType" property, where the type of value defined contains the value of the element describes the array with the dimension. The value of the "ENC: ArrayType" property is as follows:

ArrayTypeValue = atype asizeatype = qname * (rank) Rank = "[" * (",") "]"] "=" ["#olength"] "= 1 * Digit" Atype "structure is an array contains elements included in arrays Name of the type, first it contains a QNAME indicating that QNAME should appear in the "Type" attribute in the XML Schema element declaration, QNAME is a constraint (meaning all of the elements they contain, should claim consistent with the specified type That is, the type referenced in ENC: ArrayType must be the type or hyperweight of all array elements). For those arrays or "jagged arrays", using the RANK structure, the element of the array is an array, and the specific type of the array will instantiate the value when the definition of the following specific member array, zero in the Rank, one To multiple commas, the member variable is a one-dimensional, two-dimensional or multi-dimensional array. For multidimensional arrays, dimension is defined as a "," separated dimension sequence, each dimension number of counts of 1. The "Asize" structure contains a length of each dimension of an array indicated by a comma-separated sequence consisting of zero, one or more integers. A sequence consisting of zero integer indicates that there is no particular limitation on the array, but the specific size will be determined by the underlying member. For example, a group with 5 members, the member type is an array, and the value of its ArrayTyPeValue should be "int [] [5]". Where the value of atype is "int []", the value of Asize is "[5]". Similarly, a group with three members, member types are INTEGER 2D arrays, and its value of ARRAYTYPEVALUE should be "int [,] [3]". Among them, the value of atype is "int [,]", and the value of asize is "[3]". The SOAP array member can include an "Enc: Offset" property to indicate the offset in the array of the member. This can also be used to indicate the offset of members in an array described in a portion (see section 5.4.2.1). Similarly, the SOAP array member can include a "enc: position" property to indicate the location of the member in its loading. This can also be used to indicate the position of the member in a sparsely described array (see section 5.4.2.2). The value of "enc: offset" and "enc: position" attribute is defined as: arraypoint = "[" #olength "]" their base is 0. NULL values ​​and default values ​​can be omitted in access identification elements. NULL value can be specified in an attribute XSI: null using a value of 1 in an access identification element, or may be other dependent attributes and values.

Note that rule 2 allows the individual elements and the member elements in the array to have different names for the included types.

5.2 Simple Type

For simple types, SOAP uses all types, including values ​​and vocabulary spaces (Lexical Spaces) defined in "Build-in DataTypes" section in "XML Schema Part 2: DataTypes" [11]. Examples include:

Typeexampleint58502float314159265358979e 1NEGATIVEINTEGER-32768STRINGLOUIS "Satchmo" ARMSTRONG

The data type declared in the XML Schema specification can be used directly in element mode. The type of these types can also be used. Below is an example of a pattern fragment and a corresponding type of element data:

EXAMPLE 7

Schema with Simple Types

Here are some legal elements:

EXAMPLE 8

45

5.9

-450

Blue

Message Fragment Corresponding to the Schema in EXAMPLE 7

Whether the simple value type is defined in the "XML Schema Part 2: DataTypes" specification, or based on the type definition mechanism provided by the XML Schema specification, it must be encoded as an element.

If a simple value is encoded as an independent element or a heterogeneity element, it is convenient to have an element declaration corresponding to the data type. Because the type definition is included in the "XML Schema Part 2: DataTypes" specification, it contains a declaration of the corresponding element, while the ENC mode and namespace declare an element for each simple data type. These are can be used.

EXAMPLE 9

45

5.2.1 String

"String" Data Type is defined in "XML Schema Part 2: DataTypes" [11]. It is worth noting that in many databases or programming languages, the "string" type is not consistent. In some special languages, only some characters may appear in "String". (These values ​​may need to represent some data types other than XSD: String)

A string can be encoded as a single reference or multi-reference value.

Elements containing the string value can have a "id" attribute. Additional access identification elements can have the "href" property that matches it.

For example, if there are two access identities to the same String, it can be manifested as:

EXAMPLE 10

Hello

Two Accessors for the Same String

In any case, it is true that two references to a String (or String subtype) are not essentially different from the instance of a String (or String subtype):

EXAMPLE 11

hello

Hello

Two Accessors for the Same String

The mode description for these examples may be:

EXAMPLE 12

XMLns: enc = "http://www.w3.org/2001/06/soap-encoding">

Schema for Example 11

(In this example, the ENC: String type for describing the element type is a convenient method to describe the type of element is "XSD: String", and it can come with "ID" and "href" properties. You can see SOAP Encoding mode is defined. Mode can also use declarations in these SOAP Encoding mode, but not necessarily.)

5.2.2 enumeration

"XML Schema Part 2: DataTypes" specification [11] defines a mechanism called "Enumeration". The SOAP data model uses this mechanism. However, due to some subtle differences in the definition, there are some subtle differences in the definition, we describe more detailed concepts and describe how to encode one of the values ​​that become a list of Raised lists. Specifically, it encodes the name of this value.

In concept, "Rapu" expressed a group of different names. A concrete rose is a specific list of different values ​​that meet the basic type. For example, a collection of color names ("Green", "BLUE", "brown") can be defined as a rose, value ("1", "3", "5") based on built-in String type, may be one Based on Integer's Rapu, and so on. "XML Schema Part 2: DataTypes" specification [11] supports all simple types of simple types outside Boolean. "XML Schema Part 2: Structure" specification [10] language can be used to define a generic type. If a mode is generated from another symbol system without a specific basic type, then "String" is used. In the following mode, "EyColor" is defined as a String's rising, which may include "Green", "Blue", "brown", and the instance data is also given.

EXAMPLE 13

XMLns: TNS = "http://example.org/2001/06/samples"

Targetnamespace = "http://example.org/2001/06/samples">

Schema with enumeration

EXAMPLE 14

brown

Message Fragment Corresponding to the schema in Example 13

5.2.3 byte arrays

A Byte array can be encoded as a single reference or multi-reference value. The coding rule of the Byte array is similar to string.

Special, elements containing a Byte array value can have a "id" attribute. Additional access identification elements can have a "href" attribute for matching.

Recommended representation of an opaque BYTE array is to use "Base64" encoding mode defined in XML Schema Specifications [10] [11], the specific encoding algorithm is defined in RFC 2045 [13]. However, the data line length of Base64 encoded data in MIME will not exist in SOAP. The "ENC: Base64" subtype should be used in SOAP to define the base64 encoding.

EXAMPLE 15

XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"

XSI: Type = "ENC: Base64">

AG93IG5VDYBICM73BIBJB3CNCG ==

Image with base64 encoding

5.3 Polymorphism

Many languages ​​allow access identities to access several types of values, each type can be used at runtime. A polymorphic access identification instance must contain a "XSI: Type" property to describe the actual value of the type.

For example, a polymorphic access identifier named "COST" with a value of "XSD: float" can be encoded as:

EXAMPLE 16

XMLns: XS = "http://www.w3.org/2001/xmlschema"

XSI: Type = "xs: float"> 29.95

POLYMORPHIC Accessor

The relative to it is a value type unchanged COST access ID.

EXAMPLE 17

29.95

Accessor Whose Value Type is invariant

5.4 composite type

SOAP defines composite types in accordance with the following structural modes that are often seen in the program language: Struct

"Struct" is a composite type value, and its member's access identifier name is the only flag of mutual distinguishment, which should be different from each other.

Array

"Array" is a composite type value, and the order position of its member is uniquely different from each other.

SOAP also allows the data to be sequencing, that is, not Array, such as a single data node in the Directed-Labled-Graph data model, there are many different access identities, some of which will occur multiple times. SOAP sequence does not require the lower data model to distinguish the order difference between the access identity, but if there is such a order, the access identity must be encoded in accordance with the order.

5.4.1 Quote for composite values

Members of the composite value are encoded to access identification elements. The access identifier is distinguished by their name (eg, in Struct), and the element name is to access the identification name. The access identity name is part, the scope is included in their type, with an unmodified element name, while others have a complete modifier.

Here is an example of a "book" structure:

EXAMPLE 18

Henry Ford

prefactory text

this is a book.

Book Structure

The following is a mode segment describing the structure:

EXAMPLE 19

XMLns: XS = 'http://www.w3.org/2001/xmlschema'>

Schema for Example 18

Below is an example of a type containing a simple type member also contains a composite type member. It shows two layers of references. Note "HREF" attribute of "Author" access identification element A reference to the value corresponding to the "ID" value. The situation in "Address" is also similar.

EXAMPLE 20

my life and work </ title></p> <p><author href = "# Person-1" /></p> <p></ E: Book></p> <p><E: Person XMLns: E = "http://example.org/2001/06/books"</p> <p>ID = "Person-1"></p> <p><name> Henry forD </ name></p> <p><address href = # Address-2 "/></p> <p></ E: Person></p> <p><E: Address XMLns: E = "http://example.org/2001/06/books" ID = "Address-2"></p> <p><email> mailto: henryford@hotmail.com </ email></p> <p><Web> http://www.henryford.com </ web></p> <p></ E: Address></p> <p>Book with Muli-Reference Addresses</p> <p>The above description is appropriate when "Person" and "Address" is needed. If you use single to describe, it should be embedded, as follows:</p> <p>EXAMPLE 21</p> <p><E: BOOK XMLNS: E = "http://example.org/2001/06/books"></p> <p><title> my life and work </ title></p> <p><author></p> <p><name> Henry forD </ name></p> <p><address></p> <p><email> mailto: henryford@hotmail.com </ email></p> <p><Web> http://www.henryford.com </ web></p> <p></ address></p> <p></ author></p> <p></ E: Book></p> <p>Book with single-reference addresses</p> <p>If there is a limit here: two people are not allowed in a given instance, and the address can be a street-address, or an electronic address (Electronic-Address). A book with two authors can be encoded as:</p> <p>EXAMPLE 22</p> <p><E: BOOK XMLNS: E = "http://example.org/2001/06/books"></p> <p><title> my life and work </ title></p> <p><firstauThor href = "# Person-1" /></p> <p><SecondAuthor Href = "# Person-2" /></p> <p></ E: Book></p> <p><E: Person XMLns: E = "http://example.org/2001/06/books"</p> <p>XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance"</p> <p>ID = "Person-1"></p> <p><name> Henry forD </ name></p> <p><address xsi: type = "e: electronicaddresstype"></p> <p><email> mailto: henryford@hotmail.com </ email></p> <p><Web> http://www.henryford.com </ web></p> <p></ address></p> <p></ E: Person></p> <p><E: Person XMLns: E = "http://example.org/2001/06/books"</p> <p>XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance"</p> <p>ID = "Person-2"></p> <p><name> Samuel Crowther </ name> <address xsi: type = "e: streetaddresstype"></p> <p><street> Martin Luther King Rd </ street></p> <p><city> raleigh </ city></p> <p><State> North Carolina </ state></p> <p></ address></p> <p></ E: Person></p> <p>Book with Two Authors Having Different Addresses</p> <p>The order can also contain some references that are not in the same resource:</p> <p>EXAMPLE 23</p> <p><E: BOOK XMLNS: E = "http://example.org/2001/06/books"></p> <p><title> paradise lost </ title></p> <p><firstauThor href = "http://www.dartmouth.edu/~milton/" /></p> <p></ E: Book></p> <p>Book with external references</p> <p>Simultaneously below is a mode description fragment of the above structure:</p> <p>EXAMPLE 24</p> <p><XS: Schema XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: TNS = "http://example.org/2001/06/books"</p> <p>TargetNamespace = "http://example.org/2001/06/books"></p> <p><xs: element name = "book" type = "tns: boxtype" /></p> <p><xs: complexType name = "boxtype"></p> <p><xs: annotation></p> <p><XS: Documentation></p> <p><info></p> <p>Either The Following Group Must Occur or else</p> <p>HREF Attribute Must Appear, But Not Both.</p> <p></ info></p> <p></ xs: documentation></p> <p></ xs: annotation></p> <p><xs: sequence minoccurs = "0" maxoccurs = "1"></p> <p><xs: element name = "title" type = "xs: string" /></p> <p><xs: element name = "firstauthor" type = "tns: persot" /></p> <p><xs: element name = "secondauthor" type = "tns: persot" /></p> <p></ xs: sequence></p> <p><xs: attribute name = "href" type = "xs: annuri" /></p> <p><xs: attribute name = "id" type = "xs: id" /></p> <p><xs: anyattribute name = "## ot" /></p> <p></ xs: complexType> <xs: element name = "Person" type = "tns: persot" /></p> <p><xs: complexType name = "persotype"></p> <p><xs: annotation></p> <p><XS: Documentation></p> <p><info></p> <p>Either The Following Group Must Occur or else</p> <p>HREF Attribute Must Appear, But Not Both.</p> <p></ info></p> <p></ xs: documentation></p> <p></ xs: annotation></p> <p><xs: sequence minoccurs = "0" maxoccurs = "1"></p> <p><xs: element name = "name" type = "xs: string" /></p> <p><xs: element name = "address" type = "tns: addresstype" /></p> <p></ xs: sequence></p> <p><xs: attribute name = "href" type = "xs: annuri" /></p> <p><xs: attribute name = "id" type = "xs: id" /></p> <p><xs: anyattribute name = "## ot" /></p> <p></ xs: complexType></p> <p><xs: element name = "address" base = "tns: addresstype" /></p> <p><xs: complexType name = "addresstype" Abstract = "true"></p> <p><xs: annotation></p> <p><XS: Documentation></p> <p><info></p> <p>Either One of the Following SEQUENCES MUST OCCUR OR</p> <p>Else The Href Attribute Must Appear, But Not Both.</p> <p></ info></p> <p></ xs: documentation></p> <p></ xs: annotation></p> <p><xs: kice></p> <p><xs: sequence minoccurs = "0" maxoccurs = "1"></p> <p><xs: element name = "email" type = "xs: string" /></p> <p><xs: element name = "Web" type = "xs: anyuri" /></p> <p></ xs: sequence></p> <p><xs: sequence minoccurs = '0' maxoccurs = '1'></p> <p><xs: element name = "street" type = "xs: string" /></p> <p><xs: element name = "city" type = "xs: string" /> <xs: element name = "state" type = "xs: string" /></p> <p></ xs: sequence></p> <p></ xs: kice></p> <p><xs: attribute name = "href" type = "xs: annuri" /></p> <p><xs: attribute name = "id" type = "xs: id" /></p> <p><xs: anyattribute name = "## ot" /></p> <p></ xs: complexType></p> <p><xs: complextype name = "streetaddresstype"></p> <p><xs: annotation></p> <p><XS: Documentation></p> <p><info></p> <p>Either The Second Sequence in The Following GROUP</p> <p>Must Occur or else the Href Attribute Must Appear,</p> <p>But not Both.</p> <p></ info></p> <p></ xs: documentation></p> <p></ xs: annotation></p> <p><xs: complextence></p> <p><xs: restriction base = "tns: addresstype"></p> <p><xs: sequence></p> <p><xs: sequence minoccurs = "0" maxoccurs = "0"></p> <p><xs: element name = "email" type = "xs: string" /></p> <p><xs: element name = "Web" type = "xs: anyuri" /></p> <p></ xs: sequence></p> <p><xs: sequence minoccurs = "0" maxoccurs = "1"></p> <p><xs: element name = "street" type = "xs: string" /></p> <p><xs: element name = "city" type = "xs: string" /></p> <p><xs: element name = "state" type = "xs: string" /></p> <p></ xs: sequence></p> <p></ xs: sequence></p> <p><xs: attribute name = "href" type = "xs: annuri" /></p> <p><xs: attribute name = "id" type = "xs: id" /></p> <p><xs: anyattribute name = "## ot" /></p> <p></ xs: restriction></p> <p></ xs: complextence></p> <p></ xs: complexType></p> <p><xs: complexType name = "electronicaddresstype"> <xs: annotation></p> <p><XS: Documentation></p> <p><info></p> <p>Either the first sequence in The Following Group? Either THE FOLLOWING GROUP</p> <p>Must Occur or else the Href Attribute Must Appear,</p> <p>But not Both.</p> <p></ info></p> <p></ xs: documentation></p> <p></ xs: annotation></p> <p><xs: complextence></p> <p><xs: restriction base = "tns: addresstype"></p> <p><xs: sequence></p> <p><xs: sequence minoccurs = "0" maxoccurs = "1"></p> <p><xs: element name = "email" type = "xs: string" /></p> <p><xs: element name = "Web" type = "xs: anyuri" /></p> <p></ xs: sequence></p> <p><xs: sequence minoccurs = "0" maxoccurs = "0"></p> <p><xs: element name = "street" type = "xs: string" /></p> <p><xs: element name = "city" type = "xs: string" /></p> <p><xs: element name = "state" type = "xs: string" /></p> <p></ xs: sequence></p> <p></ xs: sequence></p> <p><xs: attribute name = "href" type = "xs: annuri" /></p> <p><xs: attribute name = "id" type = "xs: id" /></p> <p><xs: anyattribute name = "## ot" /></p> <p></ xs: restriction></p> <p></ xs: complextence></p> <p></ xs: complexType></p> <p></ xs: schema></p> <p>Schema for example 22</p> <p>5.4.2 array</p> <p>The SOAP array is defined as the type "ENC: Array" or type "Enc: array" (see Rule 8). This type is from the type of "enc: array" must be followed by "Enc: array", and it can be used to indicate the type definition of the following, such as an array of integer numbers or some user-defined enumeration types. Array, etc. The array is expressed as an element value that is not particularly constrained for the name of the element containing its elements (就 象 值 generally does not constrain the name containing elements). The elements that make up the array can be any type, including nesting arrays.</p> <p>The representation of the array value is an ordered sequence of an array component. As a value of an array, the element name is not important for distinguishing access identification. Elements can have any name. In fact, the naming of these elements will be determined by the recommendations declared in the mode or by their type. As usual in the composite type, if the value of the entries in the array is single-quoted value, the entry will contain its value. Otherwise, the entry references its value through the "href" attribute. Below is a plurality of segments and an array containing Integer members:</p> <p>EXAMPLE 25</p> <p><XS: Schema XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"></p> <p><xs: import namespace = "http://www.w3.org/2001/06/SOAP-ENCODING" /></p> <p><xs: element name = "myfavoritenumbers" type = "enc: array" /></p> <p></ xs: schema></p> <p>Schema declaring an array of integers</p> <p>EXAMPLE 26</p> <p><myfavoritenumbers xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>Enc: arraytype = "xs: int [2]"></p> <p><Number> 3 </ Number></p> <p><Number> 4 </ Number></p> <p></ myfavoritenumbers></p> <p>Array Conforming to The Schema in Example 25</p> <p>In this example, the "MyFavoritenumber" array contains several members, and the type of each member is XS: int. The type is determined by the eNC: ArrayType property. Note that Enc: The type of Array allows uncompected unmodified elements. These names only transmit non-type information, so when they are specifically used, there is an XSI: Type property, either containing its elements to include an ENC: ArrayType property. Naturally, from the type of ENC: Array can declare a local element with type information.</p> <p>As previously pointed, the ENC mode contains some elements of the element name, and these names correspond to each simple type in "XML Schema Part 2: DataTypes" specification [11]. This also includes a statement of "array". Using these definitions, we may be able to reverse the previous description to rewrite as:</p> <p>EXAMPLE 27</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>Enc: arraytype = "xs: int [2]"></p> <p><Enc: int> 3 </ eNC: INT></p> <p><Enc: int> 4 </ eNC: INT></p> <p></ eNC: array></p> <p>Using the enc: array element</p> <p>An array can contain an instance of a subtype of arbitrating ArrayType. That is, the type of member can be any alternative type described in the ArrayType property, which will be in accordance with the alternative rules represented in the mode. Thus, for example, an integer array may include any value derived from the type of Integer (eg, "int" or any user-defined type). Similarly, a "address" array can contain a strict or extended type, such as "InternationalAddress". Because the supplied ENC: Array type allows for members that contain any type or type mixing unless there is a particular limit to the ArrayTYPE property. Member element type can be described in an instance using XSI: Type, or declared in member element mode, as shown separately in the two arrays:</p> <p>EXAMPLE 28</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance"</p> <p>Enc: arraytype = "xs: anntype [4]"></p> <p><Thing XSI: Type = "XS: INT"> 12345 </ thing></p> <p><Thing XSI: Type = "XS: Decimal"> 6.789 </ thing></p> <p><Thing XSI: Type = "XS: String"></p> <p>Of manfirst disobedience, and the fruit</p> <p>Of this forbidden tree, whose mortal tast</p> <p>Brought Death Into The World, And All Our Woe,</p> <p></ thing></p> <p><Thing XSI: Type = "xs: anyuri"></p> <p>http://www.dartmouth.edu/~milton/reading_room/</p> <p></ thing></p> <p></ eNC: array></p> <p>Array with Elements of Varying Types</p> <p>EXAMPLE 29</p> <p><Enc: array xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>Enc: arraytype = "xs: anntype [4]"></p> <p><Enc: int> 12345 </ eNC: INT></p> <p><Enc: Decimal> 6.789 </ Enc: Decimal></p> <p><Enc: String></p> <p>Of manfirst disobedience, and the fruit</p> <p>Of this forbidden tree, whose mortal tast</p> <p>Brought Death Into The World, And All Our Woe,</p> <p></ eNC: String></p> <p><Enc: anyuri></p> <p>http://www.dartmouth.edu/~milton/reading_room/</p> <p></ eNC: Anyuri></p> <p></ eNC: array></p> <p>Array with Elements of Varying Types</p> <p>The array value can be a structure or other composite value. For example an array of "xyz: order" structure: EXAMPLE 30</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: xyz = "http://example.org/2001/06/orders"</p> <p>ENC: arraytype = "xyz: ORDER [2]"></p> <p><Order></p> <p><Product> Apple </ product></p> <p><Price> 1.56 </ price></p> <p></ Order></p> <p><Order></p> <p><Product> peach </ product></p> <p><Price> 1.48 </ price></p> <p></ Order></p> <p></ eNC: array></p> <p>Arrays Containing Structs and Other Compound Values</p> <p>An array can also have some member values ​​to be an array. Below is an example of an array of two arrays, and that two arrays are String arrays:</p> <p>EXAMPLE 31</p> <p><Enc: array xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>Enc: arraytype = "xs: string [] [2]"></p> <p><item href = # array-1 "/></p> <p><item href = # array-2 "/></p> <p></ eNC: array></p> <p><Enc: array xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>ID = "array-1"</p> <p>Enc: ArrayType = "XS: String [2]"></p> <p><item> R1C1 </ item></p> <p><item> R1C2 </ item></p> <p><item> R1C3 </ item></p> <p></ eNC: array></p> <p><Enc: array xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>ID = "array-2"</p> <p>Enc: ArrayType = "XS: String [2]"></p> <p><Item> R2C1 </ item></p> <p><Item> R2C2 </ item></p> <p></ eNC: array></p> <p>Array Containing Other Arrays</p> <p>Elements containing an array value do not need to be named "Enc: Array". It can have any name, and the type provided is eNC: array, or is restricted by the ENC: Array. For example, the following is a mode fragment and an array of instances with which:</p> <p>EXAMPLE 32</p> <p><XS: Schema XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding" XMLns: TNS = "http://example.org/2001/06/numbers"</p> <p>Targetnamespace = "http://example.org/2001/06/numbers"></p> <p><XS: SimpleType Name = "Phonenumbertype"></p> <p><xs: restriction base = "xs: string" /></p> <p></ xs: simpletype></p> <p><xs: element name = "arrayofphonenumbers" type = "tns: arrayofphonenumberstype" /></p> <p><xs: complexType name = "arrayofphonenumberstype"></p> <p><xs: complextence></p> <p><xs: restriction base = "enc: array"></p> <p><xs: sequence></p> <p><xs: element name = "phonenumber" type = "tns: phonenumbertype" maxoccurs = "unbounded" /></p> <p></ xs: sequence></p> <p><xs: attributegroup ref = "enc: arrayattributes" /></p> <p><xs: attributegroup ref = "enc: commonattributes" /></p> <p></ xs: restriction></p> <p></ xs: complextence></p> <p></ xs: complexType></p> <p></ xs: schema></p> <p>Schema for an arch</p> <p>EXAMPLE 33</p> <p><abc: arrayofphonenumbers xmlns: abc = "http://example.org/2001/06/numbers"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>ENC: ArrayType = "ABC: Phonenumbertype [2]"></p> <p><phonenumber> 206-555-1212 </ phonenumber></p> <p><phonenumber> 1-888-123-4567 </ phonenumber></p> <p></ abc: arrayofphonenumbers></p> <p>Array Conforming to The Schema in Example 32</p> <p>The array can be multi-dimensional. In this case, there will be a number of values ​​that describe the dimension size appears in the ASIZE section of the ArrayType property:</p> <p>EXAMPLE 34</p> <p><Enc: array xmlns: xs = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>ENC: ArrayType = "XS: String [2,3]"></p> <p><item> R1C1 </ item></p> <p><item> R1C2 </ item></p> <p><item> R1C3 </ item> <item> R2C1 </ item></p> <p><Item> R2C2 </ item></p> <p><item> R2C3 </ item></p> <p></ eNC: array></p> <p>Multi-Dimensonal Array</p> <p>In the above example, a array is displayed as an independent element, and the array value can appear in a nested manner and if they are singing, it should be used.</p> <p>Below is an example of a pattern fragment and a telephone number array in accordance with this mode in the "Person" structure, which can be accessed from access identity "phone-number":</p> <p>EXAMPLE 34</p> <p><XS: Schema XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: TNS = "http://example.org/2001/06/numbers"</p> <p>Targetnamespace = "http://example.org/2001/06/numbers"></p> <p><xs: import namespace = "http://www.w3.org/2001/06/SOAP-ENCODING" /></p> <p><XS: SimpleType Name = "Phonenumbertype"></p> <p><xs: restriction base = "xs: string" /></p> <p></ xs: simpletype></p> <p><xs: element name = "arrayofphonenumbers" type = "tns: arrayofphonenumberstype" /></p> <p><xs: complexType name = "arrayofphonenumberstype"></p> <p><xs: complextence></p> <p><xs: restriction base = "enc: array"></p> <p><xs: sequence></p> <p><xs: element name = "phonenumber" type = "tns: phonenumbertype" maxoccurs = "unbounded" /></p> <p></ xs: sequence></p> <p><xs: attributegroup ref = "enc: arrayattributes" /></p> <p><xs: attributegroup ref = "enc: commonattributes" /></p> <p></ xs: restriction></p> <p></ xs: complextence></p> <p></ xs: complexType></p> <p><XS: Element Name = "Person"></p> <p><XS: ComplexType></p> <p><xs: sequence></p> <p><xs: element name = "name" type = "xs: string" /></p> <p><xs: element name = "phonenumbers" type = "tns: arrayofphonenumberstype" /></p> <p></ xs: sequence></p> <p></ xs: complexType></p> <p></ xs: element></p> <p></ xs: schema></p> <p>Schema fragment for array of phone numbers embedded in a structure</p> <p>EXAMPLE 35</p> <p><Def: Person XMLns: DEF = "http://example.org/2001/06/numbers"</p> <p>XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"></p> <p><name> john hancock </ name></p> <p><phonenumbers enc: arraytype = "Def: phonenumber [2]"></p> <p><phonenumber> 206-555-1212 </ phonenumber></p> <p><phonenumber> 1-888-123-4567 </ phonenumber></p> <p></ phonenumbers></p> <p></ def: Person></p> <p>Array of Phone Numbers Embedded in A Struct Conforming To The Schema in Example 34</p> <p>Below is another example of a single array value, the array value is encoded as an embedded element, which includes an element name as an access identifier:</p> <p>EXAMPLE 36</p> <p><xyz: purchaseorder xmlns: xyz = "http://example.org/2001/06/orders"></p> <p><Customername> Henry Ford </ Customername></p> <p><Shipto></p> <p><Street> 5th ave </ street></p> <p><City> new york </ city></p> <p><State> NY </ state></p> <p><Zip> 10010 </ zip></p> <p></ Shipto></p> <p><PurchaselineItems XMLns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>ENC: arraytype = "xyz: ORDER [2]"></p> <p><Order></p> <p><Product> Apple </ product></p> <p><Price> 1.56 </ price></p> <p></ Order></p> <p><Order></p> <p><Product> peach </ product></p> <p><Price> 1.48 </ price></p> <p></ Order></p> <p></ PurchaselineItems></p> <p></ xyz: purchaseorder></p> <p>SINGLE-REFERENCE ARRAY ENCODED AS EN Embedded Element</p> <p>5.4.2.1 Partial transmission array</p> <p>SOAP provides support for partial delivery arrays, which is like "variable long" arrays in some context [12]. A portion of the transfer number should use the "Enc: Offset" attribute identifier, which is started with the displacement of the first element. If this property is omitted, the displacement is 0.</p> <p>Below is an array of size 5, while only passing the third and fourth elements at the time of delivery:</p> <p>EXAMPLE 37</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: XS = "http://www.w3.org/2001/xmlschema" Enc: arraytype = "xs: string [6]"</p> <p>Enc: offset = "[3]"></p> <p><item> The fourth element </ item></p> <p><item> the fiffh element </ item></p> <p></ eNC: array></p> <p>Array of Size Five That Transmits Only The Third and Fourth Element</p> <p>5.4.2.2 Sparse array</p> <p>SOAP provides support for sparse arrays. Each element represents a member value contains an "eNC: Position" property to indicate that it is in an array. Below is an example of a sparse array of two-dimensional character array. His size is 4, but only position 2 is used:</p> <p>EXAMPLE 38</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>ENC: ArrayType = "xs: string [,] [4]"></p> <p><Enc: array href = "# array-1" enc: position = "[2]" /></p> <p></ eNC: array></p> <p><enc: array id = "array-1"</p> <p>Enc: arraytype = "xs: string [10,10]"></p> <p><item enc: position = "[2, 2]"> Third Row, Third Col </ item></p> <p><item enc: position = "[7, 2]> EIGHTH ROW, THIRD COL </ Item></p> <p></ eNC: array></p> <p>Sparse array</p> <p>If there is only one reference to Array-1 in the above array, the above example can be encoded as:</p> <p>EXAMPLE 39</p> <p><Enc: array xmlns: enc = "http://www.w3.org/2001/06/soap-encoding"</p> <p>XMLns: XS = "http://www.w3.org/2001/xmlschema"</p> <p>ENC: ArrayType = "xs: string [,] [4]"></p> <p><Enc: array enc: position = "[2]" Enc: arraytype = "xs: string [10,10]"></p> <p><item enc: position = "[2, 2]"> Third Row, Third Col </ item></p> <p><item enc: position = "[7, 2]> EIGHTH ROW, THIRD COL </ Item></p> <p></ eNC: array></p> <p></ eNC: array></p> <p>Another sparse array</p> <p>5.4.3 Universal Composite Type</p> <p>The encoding rules referenced above are not limited to those who know the access identity in advance. If the access identification name is only when the appearance of the value is determined during the encoding process, the same rule can also be applied, that is, an access identifier is encoded as the same name, and the access identity either contains either Value. The access identity containing those types that cannot be pre-determined must include a suitable XSI: Type property to give the value of the value. Similarly, the reference rules are already sufficient for composite types containing some hybrid access identifications, and these access identifications are distinguished by name, some are distinguished by name and location (that is, some access The logo will be repeated). This does not necessarily need to include this type of mode, but if a type model mode does not have this type, then a corresponding XML syntax mode and instance should be generated.</p> <p>EXAMPLE 40</p> <p><xyz: purchaseorder xmlns: xyz = "http://example.org/2001/06/orders"></p> <p><Customername> Henry Ford </ Customername></p> <p><Shipto></p> <p><Street> 5th ave </ street></p> <p><City> new york </ city></p> <p><State> NY </ state></p> <p><Zip> 10010 </ zip></p> <p></ Shipto></p> <p><PurchaselineItems></p> <p><Order></p> <p><Product> Apple </ product></p> <p><Price> 1.56 </ price></p> <p></ Order></p> <p><Order></p> <p><Product> peach </ product></p> <p><Price> 1.48 </ price></p> <p></ Order></p> <p></ PurchaselineItems></p> <p></ xyz: purchaseorder></p> <p>Generic Compound Types</p> <p>Similarly, order a composite type value is legitimate, but this is not an Enc: Array type or its subtype. E.g:</p> <p>EXAMPLE 41</p> <p><PurchaselineItems></p> <p><Order></p> <p><Product> Apple </ product></p> <p><Price> 1.56 </ price></p> <p></ Order></p> <p><Order></p> <p><Product> peach </ product></p> <p><Price> 1.48 </ price></p> <p></ Order></p> <p></ PurchaselineItems></p> <p>Compound Value</p> <p>5.5 default value</p> <p>An omissive format of access identification element is to have a default or not knowing its value. This details are based on access identification, methods, and context. For example, an omissive access identification typically represents a NULL value of a polymorphic access identifier (NULL dependent access identification). Similarly, a omissive format Boolean access identifier typically means a FALSE value or a value of unknown, while a numerical access identifier of a omission format typically means that its value is 0 or a value unknown.</p> <p>5.6 SOAP root properties</p> <p>The SOAP root property can be used to mark the root of the order, of course, he is not the true root of the object map, so the object map can be desirated. This attribute can give any one of two values ​​of "0" and "1". The real root of an object map generally has a value "1". Those non-real roots can also be labeled as a descending root that is given value "1". An element can also be explicitly labeled as a non-sorted root of the value of "0".</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-30710.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="30710" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.047</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'F8Eikcby7b9nqBsK5yxaGni8Q8pBnm9qfg_2BXPFXEmcpQv0ZNZPiyNIllEKc1JgPVoiWFeVkdkN5DKkJm2JeL9g_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>