The Galactic Patrol

Saving the Universe from Boskone and Bugs

WS-Eventing Part III: The Notification Message

Ok, now pay close attention; this part gets real complicated.  The required elements of a notification message (that is, the shark-attack message sent to the subscriber) are as follows:

That’s right, there are no required elements.  Any SOAP message can be a valid notification.  The event source and the event sink (aka the subscriber) must agree on the notification format, and the WS-Eventing spec doesn’t mandate how that agreement is achieved.  A couple options occur to me off the top of my head.  Documentation can specify the format, and both sides can simply use the same documented format for the message.  Alternatively, the format could be published via WSDL at the event source, which the subscriber could use to process the notification message or generate a proxy for it.  (Or would that be a stub?)

If the subscriber really needs to know which subscription a particular notification is associated with, that subscriber can attach a tag to the subscription request.  That tag will then be included in all notification messages the event source sends to that subscriber.  The tag looks like this:

<Envelope>

    <Header>

        <Action>http://schemas.xmlsoap.org/ws/2004/01/eventing/Subscribe</Action>

        <MessageID>http://www.me.com/subscriptions/583</MessageID>

        <ReplyTo>http://www.me.com/subscription-response-handler</ReplyTo>

        <To>http://www.ocean.com/notifications/shark-attacks</To>

    </Header>

    <Body>

        <Subscribe>

            <NotifyTo>

                <Address>http://www.me.com/shark-attack-notification-handler</Address>

                <ReferenceProperties>

                    <MyCustomHeader>This is from my shark-attack subscription!</MyCustomHeader>

                </ReferenceProperties>

            </NotifyTo>

        </Subscribe>

    </Body>

</Envelope>

This will force the event source to add that tag as a header to every notification that it sends to that subscriber, like so:

<Envelope>

    <Header>

        <To> http://www.me.com/shark-attack-notification-handler</To>

        <MyCustomHeader>This is from my shark-attack subscription!</MyCustomHeader>

    </Header>

    <Body>

        <SharkAttackInfo>

           <Location>Daytona Beach</Location>

           <NumberOfStitches>184</NumberOfStitches>

        </Subscribe>

    </Body>

</Envelope>

Published Tuesday, February 17, 2004 5:10 AM by bwill
Filed under:

Comments

 

MasterMaq.NET said:

February 17, 2004 3:11 AM
 

Mike J said:

is publishing with "MyCustomHeader" tag actually required by WS-E or one of the things that occur to you?

Thanks. Great job.
February 17, 2004 8:16 AM
 

Bruce Williams [MSFT] said:

Mike, I made up the element name; it could be anything, and does not need to be specified. If the subscriber does include any elements inside the <ReferenceProperties> of the subscription, however, the event source MUST echo them back inside each notification to that subscriber.
February 17, 2004 8:35 AM
 

Mike J said:

Sweet. Thanks. BTW, did you remember to color code all of the places where data gets forwarded from the subscription to the response? I'm using RSSBandit and most of the text is still black, except that which is blue.
February 17, 2004 11:47 AM
 

Bruce Williams [MSFT] said:

My pleasure; I love feedback! When I look at "Part II" I see some stuff highlighted in blue, green, and yellow. If you aren't seeing that, then RSSBandit is probably stripping that formatting off.
February 17, 2004 12:42 PM
 

Matt said:

I am trying to figure out how to define the web service that receives the different eventing messages. Are there any samples around in C# or VB.NET that defines a simple subscription web service method?

I have found how to add the SOAP header but I really want to see how all the namespaces are added into the web service so the WSDL is correct.

Thanks.
March 11, 2004 2:24 PM
 

UGbLog di Pierre Greborio said:

January 6, 2005 5:51 PM
 

UGbLog di Pierre Greborio said:

January 6, 2005 5:51 PM
 

WS-Eventing Part III: The Notification Message said:

November 26, 2007 6:10 AM
 

The Galactic Patrol WS Eventing Part III The Notification Message | Cellulite Creams said:

June 9, 2009 9:41 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker