« UDDI Face to Face Meeting | Main | Versioning Web Service Information in UDDI »

February 18, 2004

WS-Eventing feedback workshop

Excited that its going on tomorrow at Tibco Palo Alto and that I have an excuse to be home in the Bay area yet a few more days. WS-Eventing is a great spec. I've provided some feedback on this blog on it already. I have more substantive suggestions for tomorrow.

Below is a sample C# command line utility I wrote tonight that allows you to subscribe a URL-specified endpoint to XPath-specified document content. It does this by sending WS-Eventing Subscribe messages to a WS-Eventing supporting Content Based Routing service. Full source (with comments even!), WS-E WSDL file, VS project files and executable is also available here. Works against our WS-Eventing implementation nicely it seems.

* Shouldn't be necessary to have such caveats on a personal blog, but it has not been tested very much at all, and for all I know has all kinds of bugs (certainly should be doing more sanity checking of the SubscribeResponse than I do below). The only real use of it will be that some variation of it will probably end up as a sample in an article or tutorial somewhere. In other words, its true CTO-quality code...

Haven't tried it against Casey Chesnut's WS-Eventing implementation (which requires Microsoft SQL Server) since I don't have SQL Server on any systems here (shocking since I was on that team at Microsoft). Any other implementations to interop test this against? I'm sure I'll find out a few tomorrow...

Couldn't resist showing how simple the program gets to be due to the straightforwardness of WS-Eventing and how easy it is to subscribe to document traffic. Now, getting source code to appear nicely on a blog is another story, as the indentation is totally lost below :-(.

using System;
namespace CBRSubscribe
{
class MainClass
{
[STAThread]
///////////////////////////
static void Main(string[] args)
{
if (args.Length<3)
{
Console.WriteLine(
"Usage: CBRSubscribe <web service for notifications> <filter expression> <CBR URL>");
return;
}
bool result;
result=Subscribe(args[0],args[1],args[2]);
if (result)
Console.WriteLine(
"Endpoint {0} is successfully subscribed to documents matching {1} with CBR service {2}!",
args[0],args[1],args[2]);
else
Console.WriteLine("Subscription failed!");
return;
}


static bool Subscribe(string notifyAddress,string subscriptionFilter,string cbrServiceURL)
{
CBRSubscribe.CBRService.Subscribe subscription=new CBRSubscribe.CBRService.Subscribe();
subscription.NotifyTo=new CBRSubscribe.CBRService.EndpointReferenceType();
subscription.NotifyTo.Address=new CBRSubscribe.CBRService.AttributedURI();
subscription.NotifyTo.Address.Value=notifyAddress;
subscription.Filter=new CBRSubscribe.CBRService.MessagePredicateAssertion();
subscription.Filter.Value=subscriptionFilter;

CBRSubscribe.CBRService.Eventing objEventing=new CBRSubscribe.CBRService.Eventing (cbrServiceURL);
CBRSubscribe.CBRService.SubscribeResponse subscribeResponse=
new CBRSubscribe.CBRService.SubscribeResponse();
subscribeResponse=objEventing.SubscribeOp(subscription);

// sanity check the subscription results
bool result=true;
if (!subscribeResponse.Id.StartsWith("uuid:"))
result=false;
return result;
}
}
}

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83456050069e200d8350370c153ef

Listed below are links to weblogs that reference WS-Eventing feedback workshop:

Comments

RV3lTt flgoey72FdAa1nc830fNdKu

ghtnbvowjne kira kenner does rare anal scene in the mountains part one and two qjfgwkgnjreg mature cocksuckers

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

September 2005

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

Companies