all groups > sql server notification services > august 2005 >
You're in the

sql server notification services

group:

Delivery Channels and Protocols


Delivery Channels and Protocols Andy
8/25/2005 12:27:59 PM
sql server notification services: Attempt 2 to post, first one did not seem to go through:

This is a duplicate from the post found at
https://forums.microsoft.com/msdn/ShowPost.aspx?PostID=78223, but just
seeming where it gets answered first.

Posting Question Asked below:

Here is what we want to do, and I have not been able to spend enough time to
see if this is possible out of the box, so thus the posting to the group.

It seems that the XSLTFormatter uses the DeviceTypeName to help allow for
different XSLT definitions. It would seem that the DeliveryChannelName would
be the better choice, since you can define multiple DeliveryChannels for the
same protocol. Also, why store the DeviceTypeName in the NSSubscriberDevices
if the DeliveryChannelName maps back to a DeviceTypeName in essence if you
were to join NSDeliveryChannels and then use the ProtocolName instead?

The reason for the question is trying to determine how to best allow for
XSLTFormatter to help format different layouts, but using the same Protocol.
What we want to do is have an Email format, but then a more restricted
device we call MobileEmail. Shyam refers to something like this in his book
in Ch. 10, by talking about a custom delivery channel that will handle
TextMessageDevice.

I am not opposed to writing custom code, but thought there has to be some
way to do this out of the box. Perhaps I am not paying enough attention to
all the details in the book, but we are on a tight timeline for this
solution. I also envision we could use locale to help without writing a
component, since we are pretty much US only.

Please let me know if I am just missing a simple piece to accomplish what I
need.

I would hope to have something like the following in ICF:

<DeliveryChannel>
<DeliveryChannelName>SMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value></Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-8</Value>
</Argument>
</Arguments>
</DeliveryChannel>
<DeliveryChannel>
<DeliveryChannelName>MobileSMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value></Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-8</Value>
</Argument>
</Arguments>
</DeliveryChannel>

Re: Delivery Channels and Protocols Joe Webb
8/25/2005 12:38:19 PM
Hi Andy -

I'm not exactly sure I understand you question completely, but
hopefully this will help.

You can use different XSLT files to format notifications in different
ways depending the type of device that will receive the notification.
BOL has a pretty good description of how you can use the device type
to format a notification appropriately for a specific device.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlntsv/htm/nsp_notifications_1gz9.asp
HTH...

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Thu, 25 Aug 2005 12:27:59 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols kate
8/26/2005 12:22:28 PM
hi andy

i think what you are saying is that you want to use the existing SMTP
channel if you can for easy dev. but you need to pick up the correct
device xslt template for the notification so that the resulting output
is suitable for the end-point device.

the NS design offers us multiple delivery channel and a protocol can be
used across one or many channels. the xslt formatter includes the
option to pick up an xslt file based on the devicetype of the channel.

so you can have 2 deliverychannels as in your sample code which both
call the SMTP protocol although each my point to a different mail
server. define a different devicetype code for each and create a
matching xslt file suitable for the target device. the only contstraint
is that because they use the same protocol they have the same data
elements to choose from . but that shouldnt be a problem.

so you should be able to do what you suggested.

Kate MBCS

Alert Technologies
http://www.alert-technologies.co.uk
Get your notification services implementation going in minutes not
weeks ......
Re: Delivery Channels and Protocols Andy
8/29/2005 8:41:17 AM
You are somewhat following what I am trying to get across, but still it does
not work, from what I read. I will try to test it in the next couple of
weeks myself and report back if it does work.



What I read is that the XSLTFormatter is based on DeviceName, such as out of
the box SMTP. If I want to send different versions of the message via SMTP I
cannot do that unless I decide to fake things out using locale.



I want to be able to send messages to two SMTP recipients without writing a
custom component.



It just seems to be the XSLTFormatter should base its logic on the Channel
Name rather than specific device type. This allows you to have multiple
formats going out via the same protocol, SMTP, without having to build a
similar component to do the job.



From my prior post let's walk through the logic, again maybe I am missing
something and it will work the way I want it too already:



I have a subscriber that wants to have notifications sent to both regular
email and a mobile device, which is restricted to amount of text it can
receive. So I would hope to define the following in the ICF:



<DeliveryChannel>
<DeliveryChannelName>SMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value></Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-8</Value>
</Argument>
</Arguments>
</DeliveryChannel>
<DeliveryChannel>
<DeliveryChannelName>MobileSMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value></Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-8</Value>
</Argument>
</Arguments>
</DeliveryChannel>



I would then create the same XSLT file, differing in how to format the
message, in the path of my XSLT to match like the following:

<xsltpath>\MobileSMTPChannel

<xsltpath>\SMTPChannel



From what I know this is not handled by NS, but only the following is since
it is based on devicename:

<xsltpath>\SMTP



I could fake things out by using the following:

<xsltpath>\SMTP <!--Will handle regular emails -->

<xsltpath>\fr-FR\SMTP <!-- Will handle mobile emails since we have no
intention to customize to other languages, so I just chose one for this
example -->



Perhaps this lays out better what I hope to achieve. Again, I will test this
in the next couple of weeks, but just thought I would get help from those
who have used is a lot more.


[quoted text, click to view]

Re: Delivery Channels and Protocols kate
8/30/2005 3:43:26 PM
i had another qwik look at DeviceTypeName and i dont think it is tied
to the protocol name as you are assuming (unless someone knows
otherwise) . I think it can be whatever you want regardless of the
protocol name that that channel will use. I havent had a chance to try
it but you should be able to define the icf as you suggest. specify the
xslt paths as

<xsltpath>\MobileSMTPChannel
<xsltpath>\SMTPChannel

when you create the subscription you would define the devicetypename as
either MobileSMTPChannel or SMTPChannel and the deliverychannel as
SMTPChannel or MobileSMTPChannel both of which point to the SMTP
protocol

i will try this myself when i get a min.

Kate MBCS

Alert Technologies
http://www.alert-technologies.co.uk
Get your notification services implementation going in minutes not
weeks ......
Re: Delivery Channels and Protocols Joe Webb
8/31/2005 7:03:44 PM
Andy -

I gotta agree with Kate on this. I think the built in SMTP protocol
should do what you're after if you define a different XSLT template
for each device type.

For example you could send emails to a cellphone formatted one way and
to a computer formatted another.

Maybe I'm misunderstanding what you're trying to do?

HTH...

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Mon, 29 Aug 2005 08:41:17 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols Andy
9/1/2005 7:26:46 AM
I tried to see if I put a folder for the channel name to see if the XSLT
would be found, it was not. It is only based on the DeviceName, in my case
SMTP.

I will find a solution, just wanted to make sure I was not missing
something. I will probably create a custom component.


[quoted text, click to view]

Re: Delivery Channels and Protocols Joe Webb
9/1/2005 10:21:12 AM
Andy -

Have you tried changing the device names to something unique like
"mobileemail" and "desktopemail"?



--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Thu, 1 Sep 2005 07:26:46 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols kate
9/1/2005 3:31:39 PM
hi andy,

as joe says, just change one of your devicenames to anything eg
TestDevicename, and then set up a matching xslt in a folder of the same
name. and give that a try.

it should pick it up correctly for notifications against the
subscription for the altered devicename

Kate MBCS

Alert Technologies
http://www.alert-technologies.co.uk
Get your notification services implementation going in minutes not
weeks ......
..
Re: Delivery Channels and Protocols Andy
9/2/2005 1:27:43 PM
I believe if I change the DeviceTypeName things will work, but I am not
clear as to what that name really means. It seemed like from examples I saw
that the DeviceTypeName matches the Protocol Name. I will try to see the
outcome if I manually change it next week some time. I hope it was just a
matter of me not interpreting the examples correctly and it will work as we
need it only adding the differences in the ICF. What if the subject needs to
be different between the two, how do you define that in the ADF?


[quoted text, click to view]

Re: Delivery Channels and Protocols Joe Webb
9/2/2005 1:44:55 PM
I'm not in a place where I can test this out, but you should be able
to create a UDF to change the subject of the of the email based on the
name of the device. I don't recall if we have access to the device
name or not in NotificationClass (my gut is telling me no) so you may
have to look it in the UDF up based on the device address.

HTH...



--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Fri, 2 Sep 2005 13:27:43 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols Andy
9/6/2005 1:16:01 PM
I have tried to change the DeviceTypeName in the NSSubscriberDevices table
to be MobileEmail from SMTP. The result was my SMTP folder is what applied
the XSLT. I have disabled the instance and stopped and restarted the
service, but nothing helped. Anything that seems to be wrong here?

Thanks.

[quoted text, click to view]

Re: Delivery Channels and Protocols Joe Webb
9/7/2005 8:12:35 AM
Do you have a folder of the same name set up, and does that folder
contain the xslt file specified in the config file?

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Tue, 6 Sep 2005 13:16:01 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols Andy
9/7/2005 12:51:28 PM
Yes I setup the folder name and the same XSLT file name in that folder.

I will try it again later next week. We are such a tight timeline, that I
need to get other basic functionality done for our solution rather than
focus on issues for one small part. That is why I have posted to the group
to see if anyone has run across the same problem.

[quoted text, click to view]

Re: Delivery Channels and Protocols kate
9/7/2005 3:13:16 PM
hi andy,

i have just had a chance to try altering the devicename and it does
work as published. i changed an existing device that was devicetypename
SMTP to SMTP2 (no change to protocol name which was EmailChannel) and
created a folder of the same case and name in the basedirectory and put
a distinctive xslt template in it of the standard name.

notification that popped out had certainly had the SMTP2 xslt applied
to it.

Kate MBCS

Alert Technologies
http://www.alert-technologies.co.uk
Get your notification services implementation going in minutes not
weeks ......
Re: Delivery Channels and Protocols Andy
9/9/2005 12:00:00 AM
I was wondering when we would get your input. Glad your back.

I believe I have finally entered my data in correctly, based on information
both Kate and Joe gave. I guess I must have just mistyped something before,
but it is now working.

What was done to accomplish it was to have a single deliverychannel, but
when the device is stored give the different formats a name that applies to
the format, so I have SMTP and MobileEmail as my two different values. I
have created the folders to match the name and am successfully sending out
emails with the formats needed.

Thanks for all the input.

[quoted text, click to view]

Re: Delivery Channels and Protocols Andy
9/9/2005 6:49:05 AM
Is that with SQL 2005 NS or SQL 2000? I wouldn't think it would make a
difference, but I will try again.

[quoted text, click to view]

Re: Delivery Channels and Protocols Joe Webb
9/9/2005 8:00:57 AM
Which CTP are you working with?



--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Fri, 9 Sep 2005 06:49:05 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
Re: Delivery Channels and Protocols Shyam Pather [MSFT]
9/9/2005 11:42:34 AM
I've been out of commission for a little while and I've just caught up on
this thread now. I'll try to explain how the device name/type/channel thing
works.

The DeviceTypeName is just a string that you use to identify a particular
type of device in your application. You can use whatever value you choose -
they just have to be well understood within your application.

DeviceTypeName is not tied to the delivery protocol name. The delivery
protocol name just identifies a particular protocol implementation to use.
This can be a built-in protocol or a custom delivery protocol.

You configure one or more delivery channels that use the delivery protocols.
The delivery channels identify specific endpoints and include
configuration/addressing information for those endpoints.

In your match rules, you specify the subscriber Id and device name for each
notification. These are used to look up the corresponding subscriber device
record. The device type from this record is passed, along with the
notification data, to the content formatter, which uses this to do
device-specific formatting. In the case of the XSLT formatter, this is used
to pick an XSLT file from an appropriately named directory.

The delivery channel name specified in the subscriber device record
identifies a delivery channel. The distributor passes the formatted
notification data to a protocol object (of the type specified in the
delivery channel definition) configured to send to the endpoint that the
delivery channel represents.

In short, here's how to get mails delivered using the standard SMTP
protocol, formatted for a variety of device types:
-Create as many SMTP delivery channels as you have SMTP servers you send to.
Every subscriber device must be configured to one of these delivery channel
and specify some device type.
-Create XSLTs for each device type you support and place them in the
appropriate subdirectories.
-Make sure your match rules specify the right device name for each
notification.

Hope this helps. All of this is explained in more detail in chapters 9 and
10 of my book.
-shyam
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Delivery Channels and Protocols Andy
9/9/2005 12:02:12 PM
June
[quoted text, click to view]

Re: Delivery Channels and Protocols Shyam Pather [MSFT]
9/9/2005 2:14:15 PM
Glad to hear it's working - it sounds like you've factored this correctly.
The NS design recognizes that device types and protocols are independent.
You can use the same protocol e.g. SMTP, to talk to a variety of device
types e.g. phones and desktop email clients.
-shyam

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Delivery Channels and Protocols Joe Webb
9/9/2005 9:00:11 PM
Fantastic. Glad you got it working! Thanks for posting a follow up.

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Fri, 9 Sep 2005 14:54:18 -0400, "Andy" <andyjax@newsgroup.nospam>
[quoted text, click to view]
AddThis Social Bookmark Button