findAccount()

Account findAccount(SearchCondition searchCondition)

This method searches by custom field for an account and returns an XML document with detailed information about the account and its associated subscriptions. This method searches only custom fields that you have defined in Smile; it does not search any default properties such as USN or username.

Parameters

searchCondition
Format: SearchCondition XML
Purpose: Defines a SearchCondition XML document that specifies the custom field attribute and value to find.

Example: Find an account by custom field

This example searches for an account that has the value JoeSmith1 in the custom field client_id.

The value in the <Attribute> element is the code name of the custom field. To find the code name, log in to Smile and click Configuration and Tools > Custom Fields, then click View next to the appropriate custom field. The code name is in the Code field.

The value in the <Value> element is the value in the custom field. If the value is part of a custom collection, specify the code name for the value. To find the code name, log in to Smile and click Configuration and Tools > Custom Collections, then click View next to the appropriate custom collection. The code names are listed next to each value in the custom collection.

<SearchCondition xmlns="http://xml.inomial.com/smile/2.xsd">
  <Equals>
    <Attribute>client_id</Attribute>
    <Value>JoeSmith1</Value>
  </Equals>
</SearchCondition>

Results

This method returns an Account XML document that contains detailed information about the account and its associated subscriptions. This method returns null if no accounts match the search criteria.

There are no messages defined by this method.

Example: A returned Account XML document

This example shows an Account XML document. The document contains some account properties (for example, billName, emailAddress and client_id) and the subscriptions linked to the account.

Note: Smile uses the key attribute on the <Timezone>, <AccountTerms> and <Costcentre> elements as an internal identifier.
<Account xmlns="http://xml.inomial.com/smile/2.xsd">
  <USN>129512142</USN>
  <InvoicingCycle>
    <CycleType>Anniversary</CycleType>
    <CycleDay>20</CycleDay>
  </InvoicingCycle>
  <RatingCycle>
    <CycleType>Anniversary</CycleType>
    <CycleDay>20</CycleDay>
  </RatingCycle>
  <Timezone key="19">Australia/Sydney</Timezone>
  <AccountTerms key="1">Default terms</AccountTerms>
  <CostCentre key="105">Example cost centre</CostCentre>
  <Properties>
    <Object>
      <String name="billName">Smith</String>
      <String name="billNumber">60</String>
      <String name="billPostCode">3000</String>
      <String name="billState">VIC</String>
      <String name="billSuburb">Melbourne</String>
      <String name="billType">ST</String>
      <String name="emailAddress">demo@example.com</String>
      <String name="name">Example Company Pty Ltd</String>
      <String name="workPhone">+61355501256</String>
      <String name="client_id">JoeSmith1</String>
    </Object>
  </Properties>
  <Subscriptions>
    <Subscription>
      <USN>1249871232</USN>
      <SID>17</SID>
      <ServiceName>ADSL</ServiceName>
      <Parent>129512142</Parent>
      <Properties>
        <Object>
          <String name="username">+61355501256</String>
        </Object>
      </Properties>
      <ProvisionStatus>Provisioned</ProvisionStatus>
      <SuspendStatus>Active</SuspendStatus>
      <ActivateStatus>Activated</ActivateStatus>
      <EnableStatus>Enabled</EnableStatus>
      <InvoicingCycle>
        <CycleType>Anniversary</CycleType>
        <CycleDay>20</CycleDay>
      </InvoicingCycle>
      <RatingCycle>
        <CycleType>Anniversary</CycleType>
        <CycleDay>20</CycleDay>
      </RatingCycle>
      <Timezone key="19">Australia/Sydney</Timezone>
    </Subscription>
  </Subscriptions>
</Account>

Faults

TooManyResultsException

This fault is returned when more than one account matches the search criteria.

NoSuchItemException

This fault is returned when the custom field that you are searching for does not exist.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.FindAccount propName value
propName
Purpose: Specifies the custom field code name.
value
Purpose: Specifies the custom field value to find.
Note: For more information about the Java client and the options it accepts, see Java client syntax.