addSubservice()
Subservice addSubservice(string usn, SubserviceRequest subservice)
This method creates a new subservice associated with an existing subscription.
Parameters
- usn
- Format: string
- subservice
- Format: SubserviceRequest XML
Example: A SubserviceRequest XML document
This example shows how to create a new subservice.
The following elements must be populated:
- <SubscriptionUSN>
- Specifies the USN of the subscription. Must be same as the usn parameter.
- <Active>
- true or false
- <SubserviceUsername>
- Specifies an alias name for the subservice. Any constraints on this name is determined by the service that the subscription is linked to.
- <Object>
- A custom object element that may be used to store additional information for the subservice.
<SubserviceRequest xmlns="http://xml.inomial.com/smile/2.xsd">
<SubscriptionUSN>9796932323</SubscriptionUSN>
<Active>true</Active>
<SubserviceUsername>joe@example.com</SubserviceUsername>
<Object>
<String name="type">emailAlias</String>
<String name="forwardTo">joe@example.com</String>
</Object>
</SubserviceRequest>
Results
This method returns a Subservice XML document describing the new subservice. This document includes the SSID field that can be used by other subservice methods.
There are no messages defined by this method.
Example: A returned Subservice XML document
This example shows a Subservice XML document for subscription 9796932323.
<Subservice xmlns="http://xml.inomial.com/smile/2.xsd">
<SSID>2344</SSID>
<SubscriptionUSN>9796932323</SubscriptionUSN>
<Active>true</Active>
<SubserviceUsername>joe@example.com</SubserviceUsername>
<Object>
<String name="type">emailAlias</String>
<String name="forwardTo">joe@example.com</String>
</Object>
</Subservice>
Faults
NoSuchItemExceptionThis fault is returned when the USN provided does not correspond to an existing subscription.
InvalidRequestExceptionThis fault is returned when either the proposed subservice username is malformed or another subservice or subscription with the same username already exists (according to the constraints set by the service).
Java client syntax
java -cp build/smilewsv2-client.jar [options]
com.inomial.smile.client.v2.examples.AddSubservices usn filename
- usn
- Purpose: Specifies the USN of the subscription.
- filename
- Purpose: Defines the filename of the SubserviceRequest XML document.
Note: For more information about the Java client and the options it
accepts, see Java client syntax.