We help IT Professionals succeed at work.

XSD Serialize/Deserialize issue

breezback
breezback asked
on
     
I'm trying to deserialize a message from a schema which define request and response messages (CustomerLookup and CustomerLookupResponse both defined in the same schema as CustomerLookupServiceType).

I have generate cs files from xsd using the xsd tool straight forward without making changes. It seems that it's not good enough. While the serialization of the request passes, the deserialization of the response doesn't work. XMl are compliant to schema according to XMLSpy.

       
[Test]
        public void DeserializeAndValidateResponse()
        {
            string fileName = @"Data\CustomerLookup\CustomerLookupResponseSample1.xml";
            
            var response = XmlGenericSerializer.Deserialize<CustomerLookupServiceType>(fileName);
            Assert.IsNotNull(response);
            string officialName = response.CustomerBody[0].PersonalIdentification[0].Name.OfficialName;
            
            Assert.IsNotNullOrEmpty(officialName);
            Assert.IsTrue(officialName.Contains(LastName));

            bool result = XML_XSD_Validator.Validate(fileName, @"Data\CustomerLookup\CustomerLookupV3.0.0.xsd");
            Assert.IsTrue(result);
        }

Open in new window

SourcesWithUnitTest.zip
Comment
Watch Question

Full stack Software Engineer
Commented:
try with the following schema:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="CustomerLookupResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" name="ARTSHeader">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" name="MessageID">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="Name" type="xs:string" use="optional" />
                      <xs:attribute name="Timestamp" type="xs:dateTime" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="DateTime">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:dateTime">
                      <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Description">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                      <xs:attribute name="Language" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Response">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="RequestID" type="xs:string" />
                    <xs:element minOccurs="0" name="ResponderID" type="xs:string" />
                    <xs:element minOccurs="0" name="ResponseTimestamp" type="xs:dateTime" />
                    <xs:element minOccurs="0" name="ResponseDescription">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                            <xs:attribute name="Language" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="BusinessError">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="ErrorID" type="xs:string" />
                          <xs:element minOccurs="0" name="Code" type="xs:string" />
                          <xs:element minOccurs="0" name="Description">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="Language" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="RelatedErrorID" type="xs:string" />
                        </xs:sequence>
                        <xs:attribute name="Severity" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="LastSuccessfulResponseID" type="xs:string" />
                  </xs:sequence>
                  <xs:attribute name="ResponseCode" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Requestor" type="xs:string" />
              <xs:element minOccurs="0" name="BusinessUnit">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                      <xs:attribute name="Name" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="OrganizationalHierarchy">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="ID" type="xs:string" use="optional" />
                      <xs:attribute name="Level" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="WorkstationID">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="Mode" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="TillID" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="MessageType" type="xs:string" use="optional" />
            <xs:attribute name="ActionCode" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" name="CustomerBody">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" name="CustomerID" type="xs:string" />
              <xs:element minOccurs="0" name="DateTime" type="xs:dateTime" />
              <xs:element minOccurs="0" name="BusinessUnitID">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                      <xs:attribute name="Name" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="OperatorID">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="OperatorType" type="xs:string" use="optional" />
                      <xs:attribute name="WorkerID" type="xs:string" use="optional" />
                      <xs:attribute name="OperatorName" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Affiliation">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Name" type="xs:string" />
                    <xs:element minOccurs="0" name="Description" type="xs:string" />
                    <xs:element minOccurs="0" name="AffiliationType" type="xs:string" />
                    <xs:element minOccurs="0" name="BusinessUnitID">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                            <xs:attribute name="Name" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                  <xs:attribute name="Action" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="AlternateID">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="OperatorType" type="xs:string" use="optional" />
                      <xs:attribute name="WorkerID" type="xs:string" use="optional" />
                      <xs:attribute name="OperatorName" type="xs:string" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="EntityInformation">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="TenantID" type="xs:string" />
                    <xs:element minOccurs="0" name="Organization">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="Name" type="xs:string" />
                          <xs:element minOccurs="0" name="DoesBusinessAs" type="xs:string" />
                          <xs:element minOccurs="0" name="TaxpayerID" type="xs:string" />
                          <xs:element minOccurs="0" name="LegalStatusCode" type="xs:string" />
                          <xs:element minOccurs="0" name="ParentCompany" type="xs:string" />
                          <xs:element minOccurs="0" name="ParentCompanyID" type="xs:string" />
                          <xs:element minOccurs="0" name="Classification">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="StockMarketSymbol">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="Exchange" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="LegalEntity" type="xs:string" />
                                <xs:element minOccurs="0" name="Citizenship" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="ContactInformation">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="StartDate" type="xs:date" />
                                <xs:element minOccurs="0" name="EndDate" type="xs:date" />
                                <xs:element minOccurs="0" name="Telephone">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="AreaCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="LocalNumber" type="xs:string" />
                                      <xs:element minOccurs="0" name="ExtensionNumber" type="xs:string" />
                                      <xs:element minOccurs="0" name="ITUCountryCode" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                    <xs:attribute name="TelephoneID" type="xs:string" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Address">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="AddressLine">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                              <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="City" type="xs:string" />
                                      <xs:element minOccurs="0" name="Territory">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                              <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="PostalCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="Country">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="Code" type="xs:string" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="PostalCodeExtension" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                    <xs:attribute name="AddressType" type="xs:string" use="optional" />
                                    <xs:attribute name="AddressID" type="xs:string" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="EMail">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="EMailAddress" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="ContactPurpose" type="xs:string" />
                                <xs:element minOccurs="0" name="SocialMedia">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Individual">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="Name">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="Salutation">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Name">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                        <xs:attribute name="Location" type="xs:string" use="optional" />
                                        <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Suffix">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="SortingName" type="xs:string" />
                                <xs:element minOccurs="0" name="MailingName" type="xs:string" />
                                <xs:element minOccurs="0" name="OfficialName" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="ContactInformation">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="StartDate" type="xs:date" />
                                <xs:element minOccurs="0" name="EndDate" type="xs:date" />
                                <xs:element minOccurs="0" name="Telephone">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="AreaCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="LocalNumber" type="xs:string" />
                                      <xs:element minOccurs="0" name="ExtensionNumber" type="xs:string" />
                                      <xs:element minOccurs="0" name="ITUCountryCode" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                    <xs:attribute name="TelephoneID" type="xs:string" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Address">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="AddressLine">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                              <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="City" type="xs:string" />
                                      <xs:element minOccurs="0" name="Territory">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                              <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="PostalCode" type="xs:string" />
                                      <xs:element minOccurs="0" name="Country">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="Code" type="xs:string" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element minOccurs="0" name="PostalCodeExtension" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                    <xs:attribute name="AddressType" type="xs:string" use="optional" />
                                    <xs:attribute name="AddressID" type="xs:string" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="EMail">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="EMailAddress" type="xs:string" />
                                    </xs:sequence>
                                    <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                    <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="ContactPurpose" type="xs:string" />
                                <xs:element minOccurs="0" name="SocialMedia">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Credentials">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="UserName" type="xs:string" />
                                <xs:element minOccurs="0" name="Password" type="xs:string" />
                                <xs:element minOccurs="0" name="Signature">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="SecurityHint">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="Question" type="xs:string" />
                                      <xs:element minOccurs="0" name="Answer" type="xs:string" />
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="EmploymentInformation">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="Employer" type="xs:string" />
                                <xs:element minOccurs="0" name="YearsOnJob" type="xs:decimal" />
                                <xs:element minOccurs="0" name="Job" type="xs:string" />
                                <xs:element minOccurs="0" name="JobTitle" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="ImportanceType" type="xs:string" />
                          <xs:element minOccurs="0" name="PersonalSummary">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="Date" type="xs:date" />
                                <xs:element minOccurs="0" name="BirthDate" type="xs:date" />
                                <xs:element minOccurs="0" name="Ethnicity" type="xs:string" />
                                <xs:element minOccurs="0" name="MaritialStatusCode" type="xs:string" />
                                <xs:element minOccurs="0" name="ReligiousAffiliationName" type="xs:string" />
                                <xs:element minOccurs="0" name="Lifestyle" type="xs:string" />
                                <xs:element minOccurs="0" name="Notes" type="xs:string" />
                                <xs:element minOccurs="0" name="Characteristics">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="Date" type="xs:date" />
                                      <xs:element minOccurs="0" name="Height" type="xs:string" />
                                      <xs:element minOccurs="0" name="Weight" type="xs:string" />
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Size">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="Date" type="xs:date" />
                                      <xs:element minOccurs="0" name="Type" type="xs:string" />
                                      <xs:element minOccurs="0" name="Size" type="xs:string" />
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="Biometrics">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="0" name="Date" type="xs:date" />
                                      <xs:element minOccurs="0" name="Image" type="xs:string" />
                                      <xs:element minOccurs="0" name="BiometricInformationRecord" type="xs:string" />
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="PhysicalStatus" type="xs:string" use="optional" />
                              <xs:attribute name="GenderType" type="xs:string" use="optional" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="SocioEconomicProfile">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="Date" type="xs:date" />
                                <xs:element minOccurs="0" name="HighestEducationalLevelName" type="xs:string" />
                                <xs:element minOccurs="0" name="AnnualIncomeAmount" type="xs:decimal" />
                                <xs:element minOccurs="0" name="NetWorth" type="xs:string" />
                                <xs:element minOccurs="0" name="Segmentation" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="PartyType" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="CumulativeBilling">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:decimal">
                      <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                      <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                      <xs:attribute name="Currency" type="xs:string" use="optional" />
                      <xs:attribute name="Quantity" type="xs:unsignedByte" use="optional" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="CustomerAccount">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                    <xs:element minOccurs="0" name="IdentityRequiredFlag" type="xs:boolean" />
                    <xs:element minOccurs="0" name="IdentityTypeCode" type="xs:string" />
                    <xs:element minOccurs="0" name="LayawayAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="FinancialBalances">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="BeginningBalanceAmount" type="xs:decimal" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="InventoryBalances" type="xs:decimal" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="InstallmentPaymentAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="FinancialBalances">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="BeginningBalanceAmount" type="xs:decimal" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="InventoryBalances" type="xs:decimal" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="ChargeAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="Number" type="xs:unsignedByte" />
                          <xs:element minOccurs="0" name="CheckDigit" type="xs:unsignedByte" />
                          <xs:element minOccurs="0" name="Balances">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="FinancialBalances">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:decimal">
                                        <xs:attribute name="BeginningBalanceAmount" type="xs:decimal" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="InventoryBalances" type="xs:decimal" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="Status" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="TradeAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="DiscountMonetaryAmount">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                                  <xs:attribute name="Currency" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="DiscountPercent" type="xs:unsignedByte" />
                          <xs:element minOccurs="0" name="Balances">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="FinancialBalances">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:decimal">
                                        <xs:attribute name="BeginningBalanceAmount" type="xs:decimal" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="InventoryBalances" type="xs:decimal" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="LoyaltyAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="LoyaltyProgramID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Name" type="xs:string" use="optional" />
                                  <xs:attribute name="Description" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="LoyaltyAccountID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Name" type="xs:string" use="optional" />
                                  <xs:attribute name="Description" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="EffectiveDate" type="xs:date" />
                          <xs:element minOccurs="0" name="ExpirationDate" type="xs:date" />
                          <xs:element minOccurs="0" name="CumulativeNetSalesAmount" type="xs:decimal" />
                          <xs:element minOccurs="0" name="Points">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Redemption">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="BusinessUnitID">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                        <xs:attribute name="Name" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="GiftCertificateSerialNumber" type="xs:string" />
                                <xs:element minOccurs="0" name="Points">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:decimal">
                                        <xs:attribute name="Type" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="MerchandiseHierarchy">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="ID" type="xs:string" use="optional" />
                                        <xs:attribute name="Level" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="ItemID" type="xs:string" />
                                <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Fees">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                                  <xs:attribute name="Currency" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="TermsID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Description" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="RentalAccount">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="SerializedUnit">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="ItemID" type="xs:string" />
                                <xs:element minOccurs="0" name="SerialNumber" type="xs:string" />
                                <xs:element minOccurs="0" name="EquipmentID" type="xs:string" />
                                <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                                <xs:element minOccurs="0" name="WarrantyCode" type="xs:string" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Adjustment">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="AdjustmentID" type="xs:string" />
                          <xs:element minOccurs="0" name="Points">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="ReasonCode" type="xs:string" />
                          <xs:element minOccurs="0" name="Description" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="CustomerBehavior">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="PurchaseHistory">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="SourceOfInquiry" type="xs:string" />
                          <xs:element minOccurs="0" name="DateOfPurchase" type="xs:dateTime" />
                          <xs:element minOccurs="0" name="AmountOfPurchase">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                                  <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                                  <xs:attribute name="Currency" type="xs:string" use="optional" />
                                  <xs:attribute name="Quantity" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="ContactHistory">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="DateTime" type="xs:string" />
                          <xs:element minOccurs="0" name="MethodType" type="xs:string" />
                          <xs:element minOccurs="0" name="Notes" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="PaymentHistory" type="xs:string" />
                    <xs:element minOccurs="0" name="ReturnHistory" type="xs:string" />
                    <xs:element minOccurs="0" name="AcquisitionSource" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="CustomerStatus">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="StartDate" type="xs:date" />
                    <xs:element minOccurs="0" name="EndDate" type="xs:date" />
                    <xs:element minOccurs="0" name="Rating">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="Type" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="GiftRegistryID" type="xs:string" />
              <xs:element minOccurs="0" name="GiftRegistration">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="BusinessUnitID">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                            <xs:attribute name="Name" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="WorkstationID">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="Mode" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="TransactionID" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="BusinessDayDate" type="xs:date" />
                    <xs:element minOccurs="0" name="DateTime" type="xs:dateTime" />
                    <xs:element minOccurs="0" name="Occasion">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                          <xs:element minOccurs="0" name="Name" type="xs:string" />
                          <xs:element minOccurs="0" name="Description" type="xs:string" />
                          <xs:element minOccurs="0" name="Date" type="xs:date" />
                          <xs:element minOccurs="0" name="RecommendedItem">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="ItemID">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="Type" type="xs:string" use="optional" />
                                        <xs:attribute name="Qualifier" type="xs:string" use="optional" />
                                        <xs:attribute name="Name" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="RecommendedQuantity" type="xs:unsignedByte" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="RegisteredItem">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element minOccurs="0" name="ItemID">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="Type" type="xs:string" use="optional" />
                                        <xs:attribute name="Qualifier" type="xs:string" use="optional" />
                                        <xs:attribute name="Name" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element minOccurs="0" name="DesiredQuantity" type="xs:unsignedByte" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="ItemCount">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="QualifiedItemID" type="xs:string" />
                    <xs:element minOccurs="0" name="IncrementalCounter" type="xs:decimal" />
                    <xs:element minOccurs="0" name="CurrentCount" type="xs:decimal" />
                    <xs:element minOccurs="0" name="TargetCount" type="xs:decimal" />
                    <xs:element minOccurs="0" name="OfferID" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Memo" type="xs:string" />
              <xs:element minOccurs="0" name="PersonalIdentification">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Name">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="Salutation">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Name">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="Location" type="xs:string" use="optional" />
                                  <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Suffix">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="SortingName" type="xs:string" />
                          <xs:element minOccurs="0" name="MailingName" type="xs:string" />
                          <xs:element minOccurs="0" name="OfficialName" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="PersonalID" type="xs:string" />
                    <xs:element minOccurs="0" name="BirthDate" type="xs:date" />
                    <xs:element minOccurs="0" name="IssueDate" type="xs:date" />
                    <xs:element minOccurs="0" name="ExpirationDate" type="xs:date" />
                    <xs:element minOccurs="0" name="Address">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="TypeCode" type="xs:string" />
                          <xs:element minOccurs="0" name="AddressLine">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="City" type="xs:string" />
                          <xs:element minOccurs="0" name="Territory">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="RelativeOrder" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="PostalCode" type="xs:string" />
                          <xs:element minOccurs="0" name="Country">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Code" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="PostalCodeExtension" type="xs:string" />
                        </xs:sequence>
                        <xs:attribute name="PrimaryFlag" type="xs:boolean" use="optional" />
                        <xs:attribute name="AddressType" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="BiometricID">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                            <xs:attribute name="EncodingMethod" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Province" type="xs:string" />
                  </xs:sequence>
                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                  <xs:attribute name="Issuer" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="PersonalPreferences">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="LanguagePreference" type="xs:string" />
                    <xs:element minOccurs="0" name="PaymentPreference" type="xs:string" />
                    <xs:element minOccurs="0" name="ContactPreference" type="xs:string" />
                    <xs:element minOccurs="0" name="MailingPreference" type="xs:string" />
                    <xs:element minOccurs="0" name="PersonalInterests" type="xs:string" />
                    <xs:element minOccurs="0" name="PrivacyPreferences" type="xs:string" />
                    <xs:element minOccurs="0" name="CreditRating">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="Status" type="xs:string" use="optional" />
                            <xs:attribute name="AcceptanceFlag" type="xs:boolean" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Promotion">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="TransactionSequenceNumber" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="PromotionID" type="xs:string" />
                    <xs:element minOccurs="0" name="CampaignID" type="xs:string" />
                    <xs:element minOccurs="0" name="Coupon" type="xs:string" />
                    <xs:element minOccurs="0" name="DiscountAmount">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:decimal">
                            <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                            <xs:attribute name="Currency" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="DiscountPercent" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="DiscountType" type="xs:string" />
                    <xs:element minOccurs="0" name="PotentialProfitability">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:decimal">
                            <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                            <xs:attribute name="Currency" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="PromotionMedium" type="xs:string" />
                    <xs:element minOccurs="0" name="PromotionsReceivedCount" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="ReadinessToBuy" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Reason" type="xs:string" />
              <xs:element minOccurs="0" name="SecurityArrangement">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="ArrangementID" type="xs:string" />
                    <xs:element minOccurs="0" name="ExpirationDate" type="xs:date" />
                  </xs:sequence>
                  <xs:attribute name="Type" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="ShoppingBasket">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="TransactionSequenceNumber" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="TransactionLink">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="BusinessUnit">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                                  <xs:attribute name="Name" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="WorkstationID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Mode" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="SequenceNumber" type="xs:unsignedByte" />
                          <xs:element minOccurs="0" name="LineItemSequenceNumber" type="xs:unsignedByte" />
                          <xs:element minOccurs="0" name="BusinessDayDate" type="xs:date" />
                          <xs:element minOccurs="0" name="BeginDateTime" type="xs:dateTime" />
                          <xs:element minOccurs="0" name="EndDateTime" type="xs:dateTime" />
                        </xs:sequence>
                        <xs:attribute name="ReasonCode" type="xs:string" use="optional" />
                        <xs:attribute name="EntryMethod" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Item">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="ItemID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                  <xs:attribute name="Qualifier" type="xs:string" use="optional" />
                                  <xs:attribute name="Name" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Price">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                                  <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                                  <xs:attribute name="Currency" type="xs:string" use="optional" />
                                  <xs:attribute name="Quantity" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Quantity">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Units" type="xs:unsignedByte" use="optional" />
                                  <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                                  <xs:attribute name="EntryMethod" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="MerchandiseHierarchy">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="ID" type="xs:string" use="optional" />
                                  <xs:attribute name="Level" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Points">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="Suggestion">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="TransactionSequenceNumber" type="xs:unsignedByte" />
                    <xs:element minOccurs="0" name="Item">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="ItemID">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                  <xs:attribute name="Qualifier" type="xs:string" use="optional" />
                                  <xs:attribute name="Name" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Price">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                                  <xs:attribute name="ForeignAmount" type="xs:decimal" use="optional" />
                                  <xs:attribute name="Currency" type="xs:string" use="optional" />
                                  <xs:attribute name="Quantity" type="xs:unsignedByte" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Quantity">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Units" type="xs:unsignedByte" use="optional" />
                                  <xs:attribute name="UnitOfMeasureCode" type="xs:string" use="optional" />
                                  <xs:attribute name="EntryMethod" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="MerchandiseHierarchy">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="ID" type="xs:string" use="optional" />
                                  <xs:attribute name="Level" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element minOccurs="0" name="Points">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="Type" type="xs:string" use="optional" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="TypeCode" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="ActionCode" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="FixVersion" type="xs:string" use="optional" />
      <xs:attribute name="MajorVersion" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="MinorVersion" type="xs:string" use="optional" />
    </xs:complexType>
  </xs:element>
</xs:schema>

Open in new window

Meir RivkinFull stack Software Engineer

Commented:
what kind of error u get when trying to deserialize?

Author

Commented:
It was regarding the root elements. When I change the models (generated by xsd) manually to explicitly have CustomerLookupRequest and CustomerLookupResponse that inherits from CustomerLookupServiceType.

THen it is working, which means that I'll need to fix a lot of classes manually...