xref: /PHP-8.2/ext/soap/tests/soap12/T42.phpt (revision 7f2f0c00)
1--TEST--
2SOAP 1.2: T42 echoStructArray
3--EXTENSIONS--
4soap
5--INI--
6precision=14
7--FILE--
8<?php
9$HTTP_RAW_POST_DATA = <<<EOF
10<?xml version="1.0"?>
11<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
12              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
13              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
14  <env:Body>
15    <test:echoStructArray xmlns:test="http://example.org/ts-tests"
16          env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
17      <inputStructArray enc:itemType="ns1:SOAPStruct"
18                        enc:arraySize="2"
19                        xmlns:ns1="http://example.org/ts-tests/xsd"
20                        xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
21        <item xsi:type="ns1:SOAPStruct">
22          <varInt xsi:type="xsd:int">42</varInt>
23          <varFloat xsi:type="xsd:float">0.005</varFloat>
24          <varString xsi:type="xsd:string">hello world</varString>
25        </item>
26        <item xsi:type="ns1:SOAPStruct">
27          <varInt xsi:type="xsd:int">43</varInt>
28          <varFloat xsi:type="xsd:float">0.123</varFloat>
29          <varString xsi:type="xsd:string">bye world</varString>
30        </item>
31      </inputStructArray>
32    </test:echoStructArray>
33  </env:Body>
34</env:Envelope>
35EOF;
36include "soap12-test.inc";
37?>
38--EXPECT--
39<?xml version="1.0" encoding="UTF-8"?>
40<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="ns2:SOAPStruct" enc:arraySize="2" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">bye world</varString><varInt xsi:type="xsd:int">43</varInt><varFloat xsi:type="xsd:float">0.123</varFloat></item></return></ns1:echoStructArrayResponse></env:Body></env:Envelope>
41ok
42