Hi, Each resource that includes the WSN NotificationProducer capability as part of its definition can have topics. These topics allow other resources to subscribe to a subset of notifications from the producer resource (the subscriber can also subscribe on behalf of other resources, in effect saying "please send notifications on topic X to resource Y (not me)"). The way to implement your scenario would be as follows:
1. Add the WSN NotificationProducer properties and operations to your WSDL. The tutorial's sample WSDL and the wsn-producer sample project WSDL both have all of the XML you need - just cut and paste. The properties are TopicExpression, TopicExpressionDialect, TopicSet, and FixedTopicSet; the operations are Subscribe and GetCurrentMessage. 2. Create an RMD (metadata) file and add a <Property/> entry for the TopicExpression property. The wsrf and wsn-producer sample projects both have example RMD files, and the WSDL portType link to those RMD files. The <Property/> metadata for TopicExpression should look like this: <Property xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" name="wsnt:TopicExpression" modifiability="read-only" mutability="constant"> <StaticValues> <wsnt:TopicExpression xmlns:myns="http://my/topic/namespace">myns:MyTopicName<wsnt:TopicExpression> ... more </StaticValues> </Property> You can fill in as many instances of TopicExpression as you like, and they will be loaded when the application is started. That way, when clients query your resource to see what topics it has (using GetResourceProperty(wsnt:TopicExpression)), they'll get the list of topics you put in the RMD file. They can then use those topic names in the subscribe() requests. In your case, you can create one <TopicExpression/> for each JMS topic you want to expose. 3. Run WSDL2Java. It will generate the code/XML for your resource definition, and add the WSN subscription resource as well. By default, one instance of your producer resource will be created at application startup, and new subscription resources will be created for each call to subscribe(). 4. From the client side, you can use org.apache.muse.ws.notification.remote.NotificationProducerClient to invoke subscribe() and getCurrentMessage(). The subscribe() method will return a SubscriptionClient, the primary use of which is to invoke destroy() when you want the notifications to stop (if ever). Let me know if you need me to elaborate on any of these steps. Dan "Beil, Matthias" <[EMAIL PROTECTED]> wrote on 03/15/2007 11:43:11 AM: > Hi, > > > > I just started with Muse and can not find a solution for my problem. > > > > My scenario is a follow: > > > > - I have several Jms Topic to manage. For each Jms Topic I want to > define a Ws-Topic where clients can subscribe to. For each subscription > a durable subscription will be created on the Jms Topic (parameter > involved are clientID and messageSelector). > > > > With the subscription created the client can either retrieve messages > via the GetCurrentMessage method, or register for receiving "notify" > messages. > > > > My question is now, how do I setup this? What kind of resource do I have > to setup? How is a resource related to a Ws-Topic and how do I address > such a Ws-Topic. Where can I find some documentation/source code or > useful information's about of those details? > > > > I have read the WS-N, WS-WSRF spec's, gone through the Muse > documentation, checked the samples, had a look over the mail archive, > but couldn't make up how resources and topic's are related which each > other. Also the addressing isn't clear for me. > > > > Any help would be appreciated. THX > > > > Mit freundlichen Gruessen / With kind regards > > Matthias Beil > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
