chandra sekhar Ответов: 2

Цикл через XML с использованием xpath


У меня есть XML, поступающий из службы WCF, я должен показать топ-10 записей searchResultsRecord из него, но я не могу пройти через него, так как Xpath ошибочен.

-<Payload xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


-<request xmlns="http://abr.business.gov.au/ABRXMLSearch/">


-<nameSearchRequest>

<authenticationGUID>88bf33e2-96a6-402c-a870-47c03af2a80b</authenticationGUID>

<name>ANZ</name>


-<filters>


-<nameType>

<tradingName>N</tradingName>

<legalName>N</legalName>

</nameType>

<postcode/>


-<stateCode>

<QLD>N</QLD>

<NT>N</NT>

<SA>N</SA>

<WA>N</WA>

<VIC>N</VIC>

<ACT>N</ACT>

<TAS>N</TAS>

<NSW>N</NSW>

</stateCode>

</filters>

</nameSearchRequest>

</request>


-<response xmlns="http://abr.business.gov.au/ABRXMLSearch/">

<usageStatement>The Registrar of the ABR monitors the quality of the information available on this website and updates the information regularly. However, neither the Registrar of the ABR nor the Commonwealth guarantee that the information available through this service (including search results) is accurate, up to date, complete or accept any liability arising from the use of or reliance upon this site.</usageStatement>

<dateRegisterLastUpdated>2019-10-23</dateRegisterLastUpdated>

<dateTimeRetrieved>2019-10-23T12:48:10.9298689+05:30</dateTimeRetrieved>


-<searchResultsList>

<numberOfRecords>201</numberOfRecords>

<exceedsMaximum>N</exceedsMaximum>


-<searchResultsRecord>


-<ABN>

<identifierValue>11005357522</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<businessName>

<organisationName>ANZ</organisationName>

<score>100</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</businessName>


-<mainBusinessPhysicalAddress>

<stateCode>VIC</stateCode>

<postcode>3008</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>30146899103</identifierValue>

<identifierStatus>Cancelled</identifierStatus>

</ABN>


-<mainName>

<organisationName>ANZ COMPANIES PTY LIMITED</organisationName>

<score>100</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2134</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>22169448220</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<mainName>

<organisationName>ANZ CORPORATION PTY LTD</organisationName>

<score>100</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2009</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>32601478849</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<businessName>

<organisationName>AUS AND NZ</organisationName>

<score>100</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</businessName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2135</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>62143244035</identifierValue>

<identifierStatus>Cancelled</identifierStatus>

</ABN>


-<mainName>

<organisationName>AUS-NZ Pty Ltd</organisationName>

<score>100</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>QLD</stateCode>

<postcode>4818</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>58620076075</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<mainName>

<organisationName>AAIH ANZ PTY LTD</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>QLD</stateCode>

<postcode>4006</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>71884645219</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<legalName>

<fullName>ABAS ANZ</fullName>

<score>97</score>

<isCurrentIndicator>N</isCurrentIndicator>

</legalName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2197</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>30124078119</identifierValue>

<identifierStatus>Cancelled</identifierStatus>

</ABN>


-<mainName>

<organisationName>ABC (AUST & NZ) PTY LTD</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>VIC</stateCode>

<postcode>3181</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>53863463962</identifierValue>

<identifierStatus>Cancelled</identifierStatus>

</ABN>


-<businessName>

<organisationName>ABIM ANZ</organisationName>

<score>97</score>

<isCurrentIndicator>N</isCurrentIndicator>

</businessName>


-<mainBusinessPhysicalAddress>

<stateCode>VIC</stateCode>

<postcode>3066</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>82133580015</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<mainName>

<organisationName>ACCA Australia & New Zealand Ltd</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2000</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>84612765143</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<mainName>

<organisationName>ACCELEDENT AUSTRALIA NZ PTY LTD</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>QLD</stateCode>

<postcode>4165</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


-<searchResultsRecord>


-<ABN>

<identifierValue>89000563002</identifierValue>

<identifierStatus>Cancelled</identifierStatus>

</ABN>


-<mainTradingName>

<organisationName>ACHESON ANZ PTY LTD</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainTradingName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2170</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>

-<ABN>

<identifierValue>51621646277</identifierValue>

<identifierStatus>Active</identifierStatus>

</ABN>


-<mainName>

<organisationName>AIRLINES FOR AUSTRALIA AND NEW ZEALAND LTD</organisationName>

<score>97</score>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainName>


-<mainBusinessPhysicalAddress>

<stateCode>NSW</stateCode>

<postcode>2020</postcode>

<isCurrentIndicator>Y</isCurrentIndicator>

</mainBusinessPhysicalAddress>

</searchResultsRecord>


Что я уже пробовал:

foreach (XElement xe in doc.Descendants("searchResultsRecord").Take(50))
           {
               XmlDocument doc1 = new XmlDocument();

               xe.Add(doc1);
           }


ОПЕРАЦИОННАЯ

foreach (XmlNode result in responseXml.SelectNodes("//Payload/searchResultsList/searchResultsRecord"))
          {
              XmlDocument doc1 = new XmlDocument();
              result.AppendChild(doc1);
          }

2 Ответов

Рейтинг:
17

RickZeeland

Сначала убедитесь, что ваш XML действителен и не содержит символов & и т.д.

<Payload xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  -<request xmlns="http://abr.business.gov.au/ABRXMLSearch/">

    -<nameSearchRequest>

      <authenticationGUID>88bf33e2-96a6-402c-a870-47c03af2a80b</authenticationGUID>
      <name>ANZ</name>


      -<filters>

        -<nameType>
          <tradingName>N</tradingName>
          <legalName>N</legalName>
        </nameType>

        <postcode/>

        -<stateCode>

          <QLD>N</QLD>

          <NT>N</NT>

          <SA>N</SA>

          <WA>N</WA>

          <VIC>N</VIC>

          <ACT>N</ACT>

          <TAS>N</TAS>

          <NSW>N</NSW>

        </stateCode>

      </filters>

    </nameSearchRequest>

  </request>


  -<response xmlns="http://abr.business.gov.au/ABRXMLSearch/">

    <usageStatement>The Registrar of the ABR monitors the quality of the information available on this website and updates the information regularly. However, neither the Registrar of the ABR nor the Commonwealth guarantee that the information available through this service (including search results) is accurate, up to date, complete or accept any liability arising from the use of or reliance upon this site.</usageStatement>

    <dateRegisterLastUpdated>2019-10-23</dateRegisterLastUpdated>

    <dateTimeRetrieved>2019-10-23T12:48:10.9298689+05:30</dateTimeRetrieved>


    -<searchResultsList>

      <numberOfRecords>201</numberOfRecords>

      <exceedsMaximum>N</exceedsMaximum>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>11005357522</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<businessName>

          <organisationName>ANZ</organisationName>

          <score>100</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </businessName>


        -<mainBusinessPhysicalAddress>

          <stateCode>VIC</stateCode>

          <postcode>3008</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>30146899103</identifierValue>

          <identifierStatus>Cancelled</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>ANZ COMPANIES PTY LIMITED</organisationName>

          <score>100</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>NSW</stateCode>

          <postcode>2134</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>22169448220</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>ANZ CORPORATION PTY LTD</organisationName>

          <score>100</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>NSW</stateCode>

          <postcode>2009</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>32601478849</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<businessName>

          <organisationName>AUS AND NZ</organisationName>

          <score>100</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </businessName>


        -<mainBusinessPhysicalAddress>

          <stateCode>NSW</stateCode>

          <postcode>2135</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>62143244035</identifierValue>

          <identifierStatus>Cancelled</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>AUS-NZ Pty Ltd</organisationName>

          <score>100</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>QLD</stateCode>

          <postcode>4818</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>58620076075</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>AAIH ANZ PTY LTD</organisationName>

          <score>97</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>QLD</stateCode>

          <postcode>4006</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>71884645219</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<legalName>

          <fullName>ABAS ANZ</fullName>

          <score>97</score>

          <isCurrentIndicator>N</isCurrentIndicator>

        </legalName>


        -<mainBusinessPhysicalAddress>

          <stateCode>NSW</stateCode>

          <postcode>2197</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>30124078119</identifierValue>

          <identifierStatus>Cancelled</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>ABC (AUST and NZ) PTY LTD</organisationName>

          <score>97</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>VIC</stateCode>

          <postcode>3181</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>53863463962</identifierValue>

          <identifierStatus>Cancelled</identifierStatus>

        </ABN>


        -<businessName>

          <organisationName>ABIM ANZ</organisationName>

          <score>97</score>

          <isCurrentIndicator>N</isCurrentIndicator>

        </businessName>


        -<mainBusinessPhysicalAddress>

          <stateCode>VIC</stateCode>

          <postcode>3066</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>82133580015</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>ACCA Australia and New Zealand Ltd</organisationName>

          <score>97</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>NSW</stateCode>

          <postcode>2000</postcode>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainBusinessPhysicalAddress>

      </searchResultsRecord>


      -<searchResultsRecord>


        -<ABN>

          <identifierValue>84612765143</identifierValue>

          <identifierStatus>Active</identifierStatus>

        </ABN>


        -<mainName>

          <organisationName>ACCELEDENT AUSTRALIA NZ PTY LTD</organisationName>

          <score>97</score>

          <isCurrentIndicator>Y</isCurrentIndicator>

        </mainName>


        -<mainBusinessPhysicalAddress>

          <stateCode>QLD</state


srko

Пожалуйста, отформатируйте его в надлежащем XML, это выглядит грязно. А также предоставить некоторое лучшее описание для исправления.

OriginalGriff

Новичку противопоставить

RickZeeland

Наконец-то хоть какая-то справедливость :)

srko

хахахахах взаимопомощи

OriginalGriff

Нет, какой-то идиот отклонил хороший ответ, поэтому я его исправил.

Рейтинг:
1

RickZeeland

Если вы предпочитаете работать с классами, вы можете воспользоваться этим онлайн-конвертером XML:
Xml2CSharp.com | преобразуйте ваши XML-примеры в совместимые классы C# XmlSerializer[^]

Он будет генерировать:

/* 
Licensed under the Apache License, Version 2.0
    
http://www.apache.org/licenses/LICENSE-2.0
*/
using System;
using System.Xml.Serialization;
using System.Collections.Generic;

namespace Xml2CSharp
{
	[XmlRoot(ElementName="nameType", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class NameType {
		[XmlElement(ElementName="tradingName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string TradingName { get; set; }
		[XmlElement(ElementName="legalName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string LegalName { get; set; }
	}

	[XmlRoot(ElementName="stateCode", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class StateCode {
		[XmlElement(ElementName="QLD", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string QLD { get; set; }
		[XmlElement(ElementName="NT", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string NT { get; set; }
		[XmlElement(ElementName="SA", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string SA { get; set; }
		[XmlElement(ElementName="WA", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string WA { get; set; }
		[XmlElement(ElementName="VIC", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string VIC { get; set; }
		[XmlElement(ElementName="ACT", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string ACT { get; set; }
		[XmlElement(ElementName="TAS", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string TAS { get; set; }
		[XmlElement(ElementName="NSW", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string NSW { get; set; }
	}

	[XmlRoot(ElementName="filters", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class Filters {
		[XmlElement(ElementName="nameType", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public NameType NameType { get; set; }
		[XmlElement(ElementName="postcode", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Postcode { get; set; }
		[XmlElement(ElementName="stateCode", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public StateCode StateCode { get; set; }
	}

	[XmlRoot(ElementName="nameSearchRequest", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class NameSearchRequest {
		[XmlElement(ElementName="authenticationGUID", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string AuthenticationGUID { get; set; }
		[XmlElement(ElementName="name", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Name { get; set; }
		[XmlElement(ElementName="filters", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public Filters Filters { get; set; }
	}

	[XmlRoot(ElementName="request", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class Request {
		[XmlElement(ElementName="nameSearchRequest", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public NameSearchRequest NameSearchRequest { get; set; }
		[XmlAttribute(AttributeName="xmlns")]
		public string Xmlns { get; set; }
	}

	[XmlRoot(ElementName="ABN", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class ABN {
		[XmlElement(ElementName="identifierValue", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IdentifierValue { get; set; }
		[XmlElement(ElementName="identifierStatus", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IdentifierStatus { get; set; }
	}

	[XmlRoot(ElementName="businessName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class BusinessName {
		[XmlElement(ElementName="organisationName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string OrganisationName { get; set; }
		[XmlElement(ElementName="score", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Score { get; set; }
		[XmlElement(ElementName="isCurrentIndicator", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IsCurrentIndicator { get; set; }
	}

	[XmlRoot(ElementName="mainBusinessPhysicalAddress", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class MainBusinessPhysicalAddress {
		[XmlElement(ElementName="stateCode", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string StateCode { get; set; }
		[XmlElement(ElementName="postcode", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Postcode { get; set; }
		[XmlElement(ElementName="isCurrentIndicator", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IsCurrentIndicator { get; set; }
	}

	[XmlRoot(ElementName="searchResultsRecord", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class SearchResultsRecord {
		[XmlElement(ElementName="ABN", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public ABN ABN { get; set; }
		[XmlElement(ElementName="businessName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public BusinessName BusinessName { get; set; }
		[XmlElement(ElementName="mainBusinessPhysicalAddress", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public MainBusinessPhysicalAddress MainBusinessPhysicalAddress { get; set; }
		[XmlElement(ElementName="mainName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public MainName MainName { get; set; }
		[XmlElement(ElementName="legalName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public LegalName LegalName { get; set; }
		[XmlElement(ElementName="mainTradingName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public MainTradingName MainTradingName { get; set; }
	}

	[XmlRoot(ElementName="mainName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class MainName {
		[XmlElement(ElementName="organisationName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string OrganisationName { get; set; }
		[XmlElement(ElementName="score", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Score { get; set; }
		[XmlElement(ElementName="isCurrentIndicator", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IsCurrentIndicator { get; set; }
	}

	[XmlRoot(ElementName="legalName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class LegalName {
		[XmlElement(ElementName="fullName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string FullName { get; set; }
		[XmlElement(ElementName="score", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Score { get; set; }
		[XmlElement(ElementName="isCurrentIndicator", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IsCurrentIndicator { get; set; }
	}

	[XmlRoot(ElementName="mainTradingName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class MainTradingName {
		[XmlElement(ElementName="organisationName", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string OrganisationName { get; set; }
		[XmlElement(ElementName="score", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string Score { get; set; }
		[XmlElement(ElementName="isCurrentIndicator", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string IsCurrentIndicator { get; set; }
	}

	[XmlRoot(ElementName="searchResultsList", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class SearchResultsList {
		[XmlElement(ElementName="numberOfRecords", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string NumberOfRecords { get; set; }
		[XmlElement(ElementName="exceedsMaximum", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string ExceedsMaximum { get; set; }
		[XmlElement(ElementName="searchResultsRecord", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public List<SearchResultsRecord> SearchResultsRecord { get; set; }
	}

	[XmlRoot(ElementName="response", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
	public class Response {
		[XmlElement(ElementName="usageStatement", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string UsageStatement { get; set; }
		[XmlElement(ElementName="dateRegisterLastUpdated", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string DateRegisterLastUpdated { get; set; }
		[XmlElement(ElementName="dateTimeRetrieved", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public string DateTimeRetrieved { get; set; }
		[XmlElement(ElementName="searchResultsList", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public SearchResultsList SearchResultsList { get; set; }
		[XmlAttribute(AttributeName="xmlns")]
		public string Xmlns { get; set; }
	}

	[XmlRoot(ElementName="Payload")]
	public class Payload {
		[XmlElement(ElementName="request", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public Request Request { get; set; }
		[XmlElement(ElementName="response", Namespace="http://abr.business.gov.au/ABRXMLSearch/")]
		public Response Response { get; set; }
		[XmlAttribute(AttributeName="xsd", Namespace="http://www.w3.org/2000/xmlns/")]
		public string Xsd { get; set; }
		[XmlAttribute(AttributeName="xsi", Namespace="http://www.w3.org/2000/xmlns/")]
		public string Xsi { get; set; }
	}

}