update()
Account update(string usn, Account account)
This method updates the contact details of an account. For example, an individual or company's service and billing addresses and contact information such as phone, mobile and email address, date of birth and sex. The method also updates data for subscriptions associated with the account.
This method updates elements nested within the <Object> element in an Account XML document, and may also update accessory data. You cannot use this method to update any elements that are outside the <Object> element.
Parameters
- usn
- Format: string
- account
- Format: Account XML
Example: Update account properties
This example changes the email address for an account and also updates secondary contact, which is a compound custom field. Note that the Account XML document contains only the property to update.
<Account xmlns="http://xml.inomial.com/smile/2.xsd">
<USN>129512142</USN>
<Properties>
<Object>
<String name="emailAddress">demo@example.com</String>
<Object name="secondaryContact">
<String name="secondaryContactName">John Smith</String>
<String name="secondaryContactNo">+61395505665</String>
</Object>
</Object>
</Properties>
</Account>
Results
This method returns an Account XML document that contains the updated state of the account.
There are no messages defined by this message.
Example: A returned Account XML document
This example shows an Account XML document returned from the previous example. The document contains account information (for example, billName and emailAddress) and information about the subscriptions linked to the account. Note that the document does not identify which property has changed.
<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>
<Object name="secondaryContact">
<String name="secondaryContactName">John Smith</String>
<String name="secondaryContactNo">+61395505665</String>
</Object>
</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
AccountExceptionThis fault is returned when the account does not exist or cannot be updated or the caller does not have permission to update the account.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.UpdateAccount usn filename
- usn
- Purpose: Specifies the USN of the account to update.
- filename
- Purpose: Defines the filename of the Account XML document.