Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
{
    "name": "Рестовый 6",
    "date_updated": {
        "sec": 1538326598,
        "usec": 100000
    },
    "role": [
        "user"
    ],
    "date_register": {
        "sec": 1538326598,
        "usec": 100000
    },
    "date": "2018-09-30",
    "email": "test_cu_26@mail.com",
    "by_user": "manager@mail.ru",
    "companies": null,
    "tasks": [
        {
            "name": "Первая задача",
            "id": 43
        },
        {
            "name": "Вторая задача",
            "id": 44
        }
    ]
}

Пример 3. SOAP с массивом данных

Запрос

Code Block
languagejava
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wrap="http://foo.bar/wrappersoapserver" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <wrap:CreateUserWithTasks>
         <email>newsupermail255@noibiz.com</email>
         <name>SOAP name 25</name>
         <tasks>
         <task>
          <task_title>Первая задача(soap 1)</task_title>
          <task_description>Описание</task_description>
         </task>
                  <task>
          <task_title>Вторая задача(soap 1)</task_title>
          <task_description>Описание</task_description>
         </task>          
         </tasks>
                  <companies soapenc:arrayType="xsd:array[]">
         		<item>513</item>
         		<item>20</item>
         	</companies>
      </wrap:CreateUserWithTasks>
   </soapenv:Body>
</soapenv:Envelope>

Ответ:

Code Block
languagejava
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://users.bugred.ru/tasks/soap/WrapperSoapServer.php" 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-ENV:Body>
      <ns1:CreateUserWithTasksResponse>
         <return xsi:type="SOAP-ENC:Struct">
            <email xsi:type="xsd:string">newsupermail255@noibiz.com</email>
            <name xsi:type="xsd:string">SOAP name 25</name>
            <avatar xsi:nil="true"/>
            <password xsi:nil="true"/>
            <birthday xsi:type="xsd:int">0</birthday>
            <gender xsi:nil="true"/>
            <date_start xsi:type="xsd:int">0</date_start>
            <hobby xsi:nil="true"/>
            <name1 xsi:type="xsd:string"/>
            <surname1 xsi:type="xsd:string"/>
            <fathername1 xsi:type="xsd:string"/>
            <cat xsi:type="xsd:string"/>
            <dog xsi:type="xsd:string"/>
            <parrot xsi:type="xsd:string"/>
            <cavy xsi:type="xsd:string"/>
            <hamster xsi:type="xsd:string"/>
            <squirrel xsi:type="xsd:string"/>
            <phone xsi:type="xsd:string"/>
            <adres xsi:type="xsd:string"/>
            <tasks SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array">
               <item xsi:type="xsd:int">303</item>
               <item xsi:type="xsd:int">304</item>
            </tasks>
            <companies SOAP-ENC:arrayType="xsd:int[1]" xsi:type="SOAP-ENC:Array">
               <item xsi:type="xsd:int">20</item>
            </companies>
         </return>
      </ns1:CreateUserWithTasksResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>