⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soap4.htm

📁 这是一个实现登陆的页面程序
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            <P><BR>&lt;enc:Array 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            enc:ArrayType="xs:int[2]" &gt; &lt;enc:int&gt;3&lt;/enc:int&gt; 
            &lt;enc:int&gt;4&lt;/enc:int&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Using the enc:Array element</P>
            <P><BR>数组可以包含任意指定arrayType的子类型的实例。也就是说,成员的类型可以是任何描述在arrayType属性中类型的可替代类型,这将依照于在模式中表示的可替代规则。因此,例如,一个整数数组可以包含任何源于integer的类型的值(例如 
            “int”或任何用户定义的源于integer的类型)。类似的,一个“address”数组可以包含一个严格的或扩展的类型,比如“internationalAddress”。因为提供的enc:Array类型允许包含任何类型或类型混合的成员,除非有对arrayType属性使用的特别限制。</P>
            <P></P>
            <P>成员元素类型在实例中可以使用xsi:type来描述,或则是在成员元素模式中声明,就象在下面两个数组中分别演示的那样:</P>
            <P></P>
            <P></P>
            <P>Example 28</P>
            <P><BR>&lt;enc:Array 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            enc:arrayType="xs:anyType[4]"&gt; &lt;thing 
            xsi:type="xs:int"&gt;12345&lt;/thing&gt; &lt;thing 
            xsi:type="xs:decimal"&gt;6.789&lt;/thing&gt; &lt;thing 
            xsi:type="xs:string"&gt; Of Mans First Disobedience, and the Fruit 
            Of that Forbidden Tree, whose mortal tast Brought Death into the 
            World, and all our woe, &lt;/thing&gt; &lt;thing 
            xsi:type="xs:anyURI"&gt; 
            http://www.dartmouth.edu/~milton/reading_room/ 
            &lt;/thing&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Array with elements of varying types</P>
            <P><BR> </P>
            <P></P>
            <P></P>
            <P>Example 29</P>
            <P><BR>&lt;enc:Array xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            enc:arrayType="xs:anyType[4]" &gt; 
            &lt;enc:int&gt;12345&lt;/enc:int&gt; 
            &lt;enc:decimal&gt;6.789&lt;/enc:decimal&gt; &lt;enc:string&gt; Of 
            Mans First Disobedience, and the Fruit Of that Forbidden Tree, whose 
            mortal tast Brought Death into the World, and all our woe, 
            &lt;/enc:string&gt; &lt;enc:anyURI&gt; 
            http://www.dartmouth.edu/~milton/reading_room/ &lt;/enc:anyURI 
            &gt;&lt;/enc:Array&gt;</P>
            <P><BR>Array with elements of varying types</P>
            <P><BR>数组值可以是结构或其他复合值。例如一个“xyz:Order”结构的数组:</P>
            <P></P>
            <P></P>
            <P>Example 30</P>
            <P><BR>&lt;enc:Array 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:xyz="http://example.org/2001/06/Orders" 
            enc:arrayType="xyz:Order[2]"&gt; &lt;Order&gt; 
            &lt;Product&gt;Apple&lt;/Product&gt; &lt;Price&gt;1.56&lt;/Price&gt; 
            &lt;/Order&gt; &lt;Order&gt; &lt;Product&gt;Peach&lt;/Product&gt; 
            &lt;Price&gt;1.48&lt;/Price&gt; &lt;/Order&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Arrays containing structs and other compound values</P>
            <P><BR>数组也可以有一些成员值是数组。下面是一个有两个数组的数组的例子,而那两个数组都是string数组:</P>
            <P></P>
            <P></P>
            <P>Example 31</P>
            <P><BR>&lt;enc:Array xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            enc:arrayType="xs:string[][2]" &gt; &lt;item href="#array-1"/&gt; 
            &lt;item href="#array-2"/&gt;&lt;/enc:Array&gt;&lt;enc:Array 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" id="array-1" 
            enc:arrayType="xs:string[2]"&gt; &lt;item&gt;r1c1&lt;/item&gt; 
            &lt;item&gt;r1c2&lt;/item&gt; 
            &lt;item&gt;r1c3&lt;/item&gt;&lt;/enc:Array&gt;&lt;enc:Array 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" id="array-2" 
            enc:arrayType="xs:string[2]"&gt; &lt;item&gt;r2c1&lt;/item&gt; 
            &lt;item&gt;r2c2&lt;/item&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Array containing other arrays</P>
            <P><BR>包含一个数组值的元素并不需要一定被命名为“enc:Array”。它可以有任意的名,而提供的类型则要么是enc:Array,要么是受源于enc:Array的限制。例如,下面是一个模式片段以及与之一致的一个实例数组:</P>
            <P></P>
            <P></P>
            <P>Example 32</P>
            <P><BR>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:tns="http://example.org/2001/06/numbers" 
            targetNamespace="http://example.org/2001/06/numbers" &gt; 
            &lt;xs:simpleType name="phoneNumberType" &gt; &lt;xs:restriction 
            base="xs:string" /&gt; &lt;/xs:simpleType&gt; &lt;xs:element 
            name="ArrayOfPhoneNumbers" type="tns:ArrayOfPhoneNumbersType" /&gt; 
            &lt;xs:complexType name="ArrayOfPhoneNumbersType" &gt; 
            &lt;xs:complexContent&gt; &lt;xs:restriction base="enc:Array" &gt; 
            &lt;xs:sequence&gt; &lt;xs:element name="phoneNumber" 
            type="tns:phoneNumberType" maxOccurs="unbounded" /&gt; 
            &lt;/xs:sequence&gt; &lt;xs:attributeGroup ref="enc:arrayAttributes" 
            /&gt; &lt;xs:attributeGroup ref="enc:commonAttributes" /&gt; 
            &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; 
            &lt;/xs:complexType&gt;&lt;/xs:schema&gt;</P>
            <P><BR>Schema for an array</P>
            <P><BR> </P>
            <P></P>
            <P></P>
            <P>Example 33</P>
            <P><BR>&lt;abc:ArrayOfPhoneNumbers 
            xmlns:abc="http://example.org/2001/06/numbers" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            enc:arrayType="abc:phoneNumberType[2]" &gt; 
            &lt;phoneNumber&gt;206-555-1212&lt;/phoneNumber&gt; 
            &lt;phoneNumber&gt;1-888-123-4567&lt;/phoneNumber&gt;&lt;/abc:ArrayOfPhoneNumbers&gt;</P>
            <P><BR>Array conforming to the schema in Example 32</P>
            <P><BR>数组可以是多维的。在这种情况下,就会有多个描述维数大小的值出现在arrayType属性的asize部分:</P>
            <P></P>
            <P></P>
            <P>Example 34</P>
            <P><BR>&lt;enc:Array xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            enc:arrayType="xs:string[2,3]" &gt; &lt;item&gt;r1c1&lt;/item&gt; 
            &lt;item&gt;r1c2&lt;/item&gt; &lt;item&gt;r1c3&lt;/item&gt; 
            &lt;item&gt;r2c1&lt;/item&gt; &lt;item&gt;r2c2&lt;/item&gt; 
            &lt;item&gt;r2c3&lt;/item&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Multi-dimensonal array</P>
            <P><BR>上述例子中显示了一个数组如何被编码为独立元素,数组值可以以嵌套方式出现并且如果他们是单引用的话,应该使用这种方式。</P>
            <P></P>
            <P>下面是一个模式片段的例子以及符合该模式的一个嵌套在“Person”结构中的电话号码数组,该数组可以从存取标识“phone-numbers”访问:</P>
            <P></P>
            <P></P>
            <P>Example 34</P>
            <P><BR>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:tns="http://example.org/2001/06/numbers" 
            targetNamespace="http://example.org/2001/06/numbers" &gt; 
            &lt;xs:import namespace="http://www.w3.org/2001/06/soap-encoding" 
            /&gt; &lt;xs:simpleType name="phoneNumberType" &gt; 
            &lt;xs:restriction base="xs:string" /&gt; &lt;/xs:simpleType&gt; 
            &lt;xs:element name="ArrayOfPhoneNumbers" 
            type="tns:ArrayOfPhoneNumbersType" /&gt; &lt;xs:complexType 
            name="ArrayOfPhoneNumbersType" &gt; &lt;xs:complexContent&gt; 
            &lt;xs:restriction base="enc:Array" &gt; &lt;xs:sequence&gt; 
            &lt;xs:element name="phoneNumber" type="tns:phoneNumberType" 
            maxOccurs="unbounded" /&gt; &lt;/xs:sequence&gt; 
            &lt;xs:attributeGroup ref="enc:arrayAttributes" /&gt; 
            &lt;xs:attributeGroup ref="enc:commonAttributes" /&gt; 
            &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; 
            &lt;/xs:complexType&gt; &lt;xs:element name="Person"&gt; 
            &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element 
            name="name" type="xs:string" /&gt; &lt;xs:element 
            name="phoneNumbers" type="tns:ArrayOfPhoneNumbersType" /&gt; 
            &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; 
            &lt;/xs:element&gt;&lt;/xs:schema&gt;</P>
            <P><BR>Schema fragment for array of phone numbers embedded in a 
            struct</P>
            <P><BR> </P>
            <P></P>
            <P></P>
            <P>Example 35</P>
            <P><BR>&lt;def:Person xmlns:def="http://example.org/2001/06/numbers" 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" &gt; 
            &lt;name&gt;John Hancock&lt;/name&gt; &lt;phoneNumbers 
            enc:arrayType="def:phoneNumber[2]"&gt; 
            &lt;phoneNumber&gt;206-555-1212&lt;/phoneNumber&gt; 
            &lt;phoneNumber&gt;1-888-123-4567&lt;/phoneNumber&gt; 
            &lt;/phoneNumbers&gt;&lt;/def:Person&gt;</P>
            <P><BR>Array of phone numbers embedded in a struct conforming to the 
            schema in Example 34</P>
            <P><BR>下面是单引用数组值的另一个例子,数组值被编码为嵌入元素,这些元素都包含作为存取标识的元素名:</P>
            <P></P>
            <P></P>
            <P>Example 36</P>
            <P><BR>&lt;xyz:PurchaseOrder 
            xmlns:xyz="http://example.org/2001/06/Orders" &gt; 
            &lt;CustomerName&gt;Henry Ford&lt;/CustomerName&gt; &lt;ShipTo&gt; 
            &lt;Street&gt;5th Ave&lt;/Street&gt; &lt;City&gt;New 
            York&lt;/City&gt; &lt;State&gt;NY&lt;/State&gt; 
            &lt;Zip&gt;10010&lt;/Zip&gt; &lt;/ShipTo&gt; &lt;PurchaseLineItems 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            enc:arrayType="xyz:Order[2]"&gt; &lt;Order&gt; 
            &lt;Product&gt;Apple&lt;/Product&gt; &lt;Price&gt;1.56&lt;/Price&gt; 
            &lt;/Order&gt; &lt;Order&gt; &lt;Product&gt;Peach&lt;/Product&gt; 
            &lt;Price&gt;1.48&lt;/Price&gt; &lt;/Order&gt; 
            &lt;/PurchaseLineItems&gt;&lt;/xyz:PurchaseOrder&gt;</P>
            <P><BR>Single-reference array encoded as en embedded element</P>
            <P><BR>5.4.2.1 部分传输数组</P>
            <P><BR>SOAP提供对部分传递数组的支持,这就象在一些上下文[12]中的“可变长”数组。一个部分传递数组应使用“enc:offset”属性标识,该属性的记数是以第一元素的位移为0开始的。如果省略该属性,则位移默认是0。</P>
            <P></P>
            <P>下面是一个大小为5的数组,同时在传递的时候仅传递第三和第四个元素:</P>
            <P></P>
            <P></P>
            <P>Example 37</P>
            <P><BR>&lt;enc:Array 
            xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            enc:arrayType="xs:string[6]" enc:offset="[3]" &gt; &lt;item&gt;The 
            fourth element&lt;/item&gt; &lt;item&gt;The fifth 
            element&lt;/item&gt;&lt;/enc:Array&gt;</P>
            <P><BR>Array of size five that transmits only the third and fourth 
            element</P>
            <P><BR>5.4.2.2 稀疏数组</P>
            <P><BR>SOAP提供对稀疏数组的支持。每一个表示成员值的元素包含一个“enc:position”属

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -