Web Services
  Home arrow Web Services arrow Page 5 - WS Notification and WS Topics in the WS Re...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

WS Notification and WS Topics in the WS Resources Framework
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-07-13

    Table of Contents:
  • WS Notification and WS Topics in the WS Resources Framework
  • Subscribing for Notification
  • The Subscription WS-Resource
  • Topics and Topic Spaces
  • TopicPathExpressions
  • Rounding Out the XML Model of Topics: aliasRef

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    WS Notification and WS Topics in the WS Resources Framework - TopicPathExpressions


    (Page 5 of 6 )

    To this point, we've only mentioned topic expressions in passing. Topic expressions appear in subscribe requests and several other places in WS-Notification. They can contain a wide variety of expression types, from simple, QName-based topic names to path expressions (like hierarchical file paths in a computer's filesystem) to rich wild- card-enabled expression languages. The type of expression is determined by the dialect attribute of a topic expression. The dialect attribute contains a URI that identifies the language used by the topic expression. WS-Topics defines several dialects, and their standard URIs are specified in that document.

    The simplest topic expression dialect, identified by the URI http://www.ibm.com/xmlns/stdwip/web-services/WS-
    Topics/TopicExpression/simple
    , can contain only QNames of root topics. This language is quite limited in that it can only identify root topics. However, in many circumstances, simple (nonhierarchical) topic spaces are sufficient. Here is an example simple topic expression that identifies the orderPlacement topic:

    <wsnt:TopicExpression dialect=
    "http://www.ibm.com/xmlns/stdwip/web-services/
    WS-Topics/TopicExpression/ simple"> crm:orderPlacement </wsnt:TopicExpression>

    The second topic expression dialect defined by WS-Topics is a straightforward path language that's similar to file paths in hierarchical directory structures. This path-based dialect is identified by the URI http://www.ibm.com/xmlns/stdwip/web-services/WS-
    Topics/TopicExpression/concreteTopicPath
    . This is a so-called concrete topic expression dialect because expressions in this dialect identify exactly one topic. This is more powerful than the simple dialect, in that child topics can be identified. In this dialect, topic expressions are combinations of topic names and topic paths (topic names separated by slashes, /, to denote hierarchical parent topic/child topic structures). Note that this dialect builds on the simple dialect: The concrete topic expression dialect also allows the QName expressions found in the simple dialect.

    Here's an example concrete topic expression, identifying the VIPComplaint child topic of the complaint topic:

    <wsnt:TopicExpression dialect=
    "http://www.ibm.com/xmlns/stdwip/web-services/
    WS-Topics/TopicExpression/ concreteTopicPath"> crm: telephoneContact/complaint/VIPComplaint </wsnt:TopicExpression>

    A third topic expression dialect defined by WS-Topics is the full topic expression dialect. The full topic expression dialect builds on the concrete topic dialect by adding wildcard (*) characters and including a conjunction (|) to allow you to express the logical or of two topic expressions. With a topic expression using this full dialect, you can specify one or more topics in a single expression:

    • Topic expressions containing a wildcard (*) may identify any number of topics. The wildcard can appear anywhere in the topic expression, either at the beginning of the topic expression, matching any root topic; or part way through a topic expression, matching any child topic at a particular level in the hierarchy.

    • A topic expression consisting just of the * character matches any topic. If this were the parameter of a subscribe request, it would suggest that the subscriber was interested in all topics supported by that notification producer.

    • A topic expression containing a wildcard after a / symbol indicates a match for all the topics at a particular level in the topic tree. For example, the topic expression crm:telephoneContact/* matches all the child topics of crm:telephoneContact. The expression crm:telephoneContact/* doesn't match the crm:telephoneContact topic itself. To match an entire subtree of topics rooted at a particular node, you use the //. construct. So the topic expression crm:telephoneContact//. matches all the topics in the entire topic tree rooted at crm:telephoneContact.

    • The | character evaluates to the set union of the topics from both expressions. This allows a subscriber to use one subscription to receive notifications from a combination of different topics. For example, if the subscriber wanted to subscribe to receive notifications on the crm:telephoneContact and the crm:emailContact topics, they would use the following topic expression: crm:telephoneContact | crm:emailContact.


    TopicExpressions and XPath - Although the authors of WS-Topics could have chosen XPath as the language to describe topic paths, it turned out that doing so wasn't straightforward. Early design attempts to make the topic expression language simple XPath (or a subset thereof) turned out to require that the topic space XML document look extremely awkward. So, the designers faced a choice: either specify an XPath subset as the topic expression language and have a very awkward-looking topic space document, or choose to have a straightforward-looking topic model in XML and develop a simple, path-based expression language. On balance, the designers chose the lesser of two evils.


    More Web Services Articles
    More By Sams Publishing


       · This article is an excerpt from the book "Building Web Services with Java: Making...
     

    Buy this book now. This article is excerpted from chapter 8 of the book Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 0672326418). Buy this book now.

    WEB SERVICES ARTICLES

    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...
    - WS Notification and WS Topics in the WS Reso...
    - Introducing the Implied Resource Pattern
    - Web Services and Stateful Resources
    - Deploying an EJB Application






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT