addSubservices()

addSubservices(string usn, SubserviceRequestList subserviceList)

This method creates bulk subservices in one method call. All subservices created will be associated with the same subscription. This method is the equivalent of invoking addSubservice() repeatedly for each subservice contained in the subserviceList parameter.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription that the new subservice will be associated with.
subserviceList
Format: SubserviceRequestList XML
Purpose: Defines a SubserviceRequestList XML document that specifies the details of the subservice.

Example: A SubserviceRequestList XML document

This example shows how to create three new subservices.

The following elements must be populated:
<SubscriptionUSN>
Specifies the USN of the subscription. Must be same as the usn parameter.
<Active>
true or false
Specifies if the subservice is active.
<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.
<SubserviceRequestList xmlns="http://xml.inomial.com/smile/2.xsd">
  <SubserviceRequest>
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>joe@example.com</SubserviceUsername>
    <Object>
      <String name="type">emailAlias</String>
      <String name="forwardTo">admin@example.com</String>
    </Object>
  </SubserviceRequest>
  <SubserviceRequest>
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>mary@example.com</SubserviceUsername>
    <Object>
      <String name="type">emailAlias</String>
      <String name="forwardTo">admin@example.com</String>
    </Object>
  </SubserviceRequest>
  <SubserviceRequest xmlns="http://xml.inomial.com/smile/2.xsd">
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>alice@example.com</SubserviceUsername>
    <Object>
      <String name="type">webHostAlias</String>
      <String name="redirectFrom">alica@example.com</String>
      <String name="redirectTo">admin@example.com</String>
    </Object>
  </SubserviceRequest>
</SubserviceRequestList>

Results

This method returns a SubserviceList XML document that contains a list of Subscription objects that correspond to the subservices created. These are populated with unique SSIDs that can be used to identify each subservice in future.

There are no messages defined by this method.

Example: A returned SubserviceList XML document

This example shows a SubserviceList XML document.

<SubserviceList xmlns="http://xml.inomial.com/smile/2.xsd">
  <Subservice>
    <SSID>2323</SSID>
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>larry@example.com</SubserviceUsername>
    <Object>
      <String name="type">emailAlias</String>
      <String name="forwardTo">stooges@example.com</String>
    </Object>
  </Subservice>
  <Subservice>
    <SSID>2324</SSID>
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>curly@example.com</SubserviceUsername>
    <Object>
      <String name="type">emailAlias</String>
      <String name="forwardTo">stooges@example.com</String>
    </Object>
  </Subservice>
  <Subservice>
    <SSID>2326</SSID>
    <SubscriptionUSN>9796932323</SubscriptionUSN>
    <Active>true</Active>
    <SubserviceUsername>moe@example.com</SubserviceUsername>
    <Object>
      <String name="type">webHostAlias</String>
      <String name="redirectFrom">moe.example.com</String>
      <String name="redirectTo">stooges.example.com</String>
    </Object>
  </Subservice>
</SubserviceList>

Faults

NoSuchItemException

This fault is returned when the USN provided does not correspond to an existing subscription.

InvalidRequestException

This fault is returned when one of the proposed subservice username is malformed or another subservice or subscription with that 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 SubserviceRequestList XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.