Type Systems Used by SOAP Encoding: Struct

Complex data types, such as a struct and an array, consist of several parts. In the C++ code example, a sample struct definition for AllStudent is defined.

struct AllStudent
{
  string sRegNum;
  string sFirstName;
  string sLastName;
  int nAge;
};

AllStudent student = {"A108”, "Rob", "Jenkins", 14};

In the XML code example, the student variable is serialized into a SOAP message payload.

<student xsi:type="x:AllStudent">
  <sRegNum xsi:type="xsd:string">
    A108
  </sRegNum>
  <sFirstName xsi:type="xsd:string">
    Rob
  </sFirstName>
  <sLastName xsi:type="xsd:string">
    Jenkins
  </sLastName>
  <nAge xsi:type="xsd:integer">
    14
  </nAge>
</student>

Click the Next button to continue.