addSubscriptionContract()
SubscriptionContract addSubscriptionContract(string usn, int contractId, dateTime startDate, dateTime endDate)
This method adds a contract to a subscription.
Parameters
- usn
- Format: string
- contractId
- Format: integer
- startDate
- Format: dateTime
- endDate
- Format: dateTime
Results
This method returns a SubscriptionContract XML document that contains information about the contract.
There are no messages defined by this method.
Example: A returned SubscriptionContract XML document
This example shows a SubscriptionContract XML document. Contract ID 557 has been added to subscription 2142422431.
<SubscriptionContract xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
<SubscriptionContractId>557</SubscriptionContractId>
<Contract key="465">24 Months</Contract>
<USN>2142422431</USN>
<EarlyTerminationCharge currency="AUD" formatted="$50.00">50</EarlyTerminationCharge>
<StartDate>2032-08-20+10:00</StartDate>
<EndDate>2034-08-19+10:00</EndDate>
<ContractValue currency="AUD" formatted="$500.00">500</ContractValue>
<MinimumTerminationCharge currency="AUD" formatted="$0.00">0</MinimumTerminationCharge>
<MaximumTerminationCharge currency="AUD" formatted="$0.00">0</MaximumTerminationCharge>
<ContractedPlanScheduleItem>1201</ContractedPlanScheduleItem>
</SubscriptionContract>
Faults
NoSuchItemExceptionThis fault is returned when the USN or contract ID do not exist.
InvalidContractExceptionThis fault is returned when the subscription's plan does not support the contract or if the contract start date overlaps another contract.
InvalidRequestExceptionThis fault is returned when the request is invalid.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.AddSubscriptionContract usn contractId startDate
- usn
- Purpose: Specifies the USN of the subscription.
- contractId
- Purpose: Specifies the ID of the contract to add.
- startDate
- Purpose: Specifies the start date and time of the contract.
- endDate
- Purpose: (Optional) Specifies the end date of the contract.
Note: For more information about the Java client and the options it
accepts, see Java client syntax.