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

sql server notification services

group:

Create Subscription from Remote Machine w/COM?



Create Subscription from Remote Machine w/COM? MarkSW
3/17/2005 11:13:04 AM
sql server notification services: I need to insert subscriptions into an NS application on an app server from
an ASP application on a Web server. The documentation describes deployment
of ASP.NET remote machine Subscriptiont management app., but not COM-based
app. from ASP, etc. Does the same deployment scenario apply? If not, are
there suggested workarounds?

If this isn't feasible my alternative ideas are:
- have ASP page redirect to an ASP.NET page that inserts the Subscription
- provide a Web service interface from my app server that the ASP calls to
insert the Subscription

Both are feasible, but undesirable for the following reason. I need a
database insert into legacy non-NS data AND this NS Subscription insert to be
(ideally) atomic/transactional. The pattern that works here is:
- open ASP ADO Transaction
- perform first DB insert
- if succeeds, then do NS COM Subscription Insert
- if succeeds then Commit
- else if fails then Rollback
- else if fails then Rollback

This pattern is not possible if the call to do the NS Subscriptions Insert
leaves the execution scope of that ASP page, either to redirect to an .aspx
or call a Web Service .asmx. So, if I have to I will, but I run a much
greater risk of the data in the two calls above getting out of synch. So,
better to be able to do this with COM API, if possible. Is it?

Re: Create Subscription from Remote Machine w/COM? Joe Webb
3/21/2005 6:09:07 AM
Mark -

Same deployment process should still apply. Make sure you reference the
Microsoft.NotificationServer.ComInterop.tlb file in your ASP application.

HTH...
Joe Webb
SQL Server MVP

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




[quoted text, click to view]
Re: Create Subscription from Remote Machine w/COM? MarkSW
4/1/2005 11:51:04 AM
Just wanted to get back to you to let you know how we ended up handling this.
We wrapped the NS SMI API in a web service, laying on some minor changes in
the semantics that match our needs, as well as error handling. This is
called from a .NET assembly on the remote machine, which provides a (at this
point) simplified interface wrapping the web service interface. This
assembly is regestered for Interop so it serves ASP and ASP.NET clients.
This seems like a nice solution because it sets up a lot of reusable
infrastructure going forward.

[quoted text, click to view]
Re: Create Subscription from Remote Machine w/COM? Joe Webb
4/4/2005 11:31:56 AM
Very nice. Thanks for posting the follow up.

HTH...
Joe Webb
SQL Server MVP

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




[quoted text, click to view]
AddThis Social Bookmark Button