共用方式為


Protocols Element (ADF)

Contains elements that define one or more delivery protocols used by the notification class to deliver notifications.

語法

<NotificationClasses>
    <NotificationClass>
        ...
        <Protocols>

Element Characteristics

Characteristic Description

Data type and length

None.

Default value

None.

Occurrence

Optional once per NotificationClass element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

NotificationClass Element (ADF)

Child elements

Protocol Element (ADF)

備註

The child elements of the Protocols element define one or more delivery protocols used by the notification class. Each notification class must have at least one delivery protocol used to deliver notifications.

If you add or delete a Protocols element, updating the application deletes and re-creates the notification class to which it corresponds. This includes dropping and re-creating the SQL Server tables used by this notification class. Any data existing in the original SQL Server tables is permanently deleted.

範例

The following example shows how to define two delivery protocols, one built-in SMTP and one custom HTTPLogger, for a notification class.

<Protocols>
    <Protocol>
        <ProtocolName>SMTP</ProtocolName>
        <Fields>
            <Field>
                <FieldName>Subject</FieldName>
                <SqlExpression>%SubjectLine%</SqlExpression>
            </Field>
            <Field>
                <FieldName>From</FieldName>
               <SqlExpression>%fromAddress%</SqlExpression>
            </Field>
            <Field>
                <FieldName>To</FieldName>
                <FieldReference>DeviceAddress</FieldReference>
            </Field>
            <Field>
                <FieldName>Priority</FieldName>
                <SqlExpression>%mailPriority%</SqlExpression>
            </Field>
            <Field>
                <FieldName>BodyFormat</FieldName>
                <SqlExpression>&quot;html&quot;</SqlExpression>
            </Field>
        </Fields>
        <ProtocolExecutionSettings>
            <RetrySchedule>
                <RetryDelay>P0DT00H15M00S</RetryDelay>
                <RetryDelay>P0DT00H30M00S</RetryDelay>
                <RetryDelay>P0DT01H00M00S</RetryDelay>
            </RetrySchedule>
        </ProtocolExecutionSettings>
    </Protocol>
    <Protocol>
        <ProtocolName>HttpLogger</ProtocolName>
        <Fields>
            <Field>
                 <FieldName>escaping</FieldName>
                <SqlExpression>'yes'</SqlExpression>
            </Field>
            <Field>
                <FieldName>Subject</FieldName>
                <SqlExpression>
                'Stock notification: '
                    +CONVERT (NVARCHAR(30), GETDATE())
                </SqlExpression>
            </Field>
            <Field>
                <FieldName>SubscriberId</FieldName>
                <SqlExpression>DeviceAddress</SqlExpression>
            </Field>
        </Fields>
    </Protocol>
</Protocols>

請參閱

參考

Application Definition File Reference

其他資源

設定傳遞通訊協定
更新執行個體及應用程式

說明及資訊

取得 SQL Server 2005 協助