Notifications and Resources in the WS-Resource Framework
This article concludes our discussion of the WS-Resource Framework, a set of proposed standards that formalizes the relationship between Web services and state. In this part, we finish covering notifications and go into greater detail about resources. It 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).
Notifications and Resources in the WS-Resource Framework - Other WS-Resource Framework Specifications (Page 6 of 6 )
When the WS-Resource Framework was announced in January 2004, a total of five specifications were included in the framework. Simultaneous with the announcement, two of the specifications were published: WS-ResourceProperties and WS-ResourceLifetime, along with a whitepaper that discussed the WS-Resource concept ("Modeling Stateful Resources Using Web Services").
The remaining three specifications were discussed, but weren't published at that time. This section presents a brief sketch of the specifications that will be made public sometime in the first half of 2004.
The uses of a WS-Addressing endpoint reference are many. An endpoint reference can be returned as part of a response message, as you saw in the updated doSubmission operation. An endpoint reference can be passed as part of an input message to a Web service. A requestor can receive an endpoint reference by some non-Web services means, such as in an email message. An endpoint reference can also be a resource property of a WS-Resource.
You can imagine that many copies of an endpoint reference can be made and shared with any number of other entities in a distributed computing system (more than is reasonable to keep track of). This poses an interesting challenge: What happens when an endpoint reference needs to change? Consider the scenario where SkatesTown wishes to migrate the location of its PurchaseOrder service to another IP address, perhaps as a result of a load balancing requirement, or due to a severe hardware or software problem on its server. Now the Address components of all the endpoint references to the PurchaseOrder service reflect an incorrect URL. How can all the copies of the endpoint reference to the PurchaseOrder be updated? This is solved by the concept of a renewable reference.
The WS-RenewableReference specification standardizes the renewable reference. WS-RenewableReferences uses WS-Policy to indicate how a requestor can renew or refresh an endpoint reference when it has become stale or incoherent due to a change made by the service provider. The policy specifies the location of one or more Web services that understands how to renew the endpoint reference to its current form.
WS-ServiceGroups is a standard means of declaring a by-value collection of Web services or WS-Resources (essentially, anything that can be pointed to by an endpoint reference). This collection is a WS-Resource and therefore can be manipulated, through a Web service in a fashion similar to what you've seen in this chapter: resource property queries, notifications on topics, lifetime management through WS-ResourceLifetime, and so on. A ServiceGroup can be used to collect Web services or WS-Resources for all sorts of purposes; for example, it can be used as a registry of available WS-Resources.
SkatesTown, for example, could use a WS-ServiceGroup to collect all the PurchaseOrder WS-Resources that are currently in process. By having a single WS-Resource, business intelligence monitoring tools can be built to occasionally query this WS-ServiceGroup to get status on the health of SkatesTown's order pipeline.
WS-BaseFaults is a simple specification, rounding out the WS-Resource Framework. It describes an XML Schema complexType for error messages associated with Web services fault messages, along with a means by which a hierarchy of application-specific extensions to this base error message complexType should be constructed. A standardized form of error messages allows tooling to be built to make the job of reporting Web services errors to
Note - You can see the final, complete WSDL for the POPortType, which manages the PurchaseOrder WS-Resources for SkatesTown, at the Sams Publishing Web site: http://www.samspublishing.com. Remember that the bulk of this WSDL is copied from WSDL portType definitions defined by the various WS-Resource Framework specifications. At the Web site, you can also view the full XML Schema definition for the resource properties document of a PurchaseOrder.
In this chapter, we introduced the WS-Resource Framework, a collection of specifications and conventions that standardize how stateful resources are represented in the Web services world. We examined how one particular stateful resource, a PurchaseOrder, is modeled by SkatesTown's use of the WS-Resource Framework. We reviewed the concept of a WS-Resource and the implied resource pattern, which is a conventional use of the endpoint reference facility from WS-Addressing to point to a WS-Resource. We explored the WS-ResourceProperties specification, which describes how elements of a WS-Resource can be queried and updated by requestors.
We outlined the WS-Notification family of specifications, which standardizes the notion of publish and subscribe (asynchronous notification) in Web services. You saw how SkatesTown used WS-Notification to replace an older, SkatesTown-proprietary approach to notification. We also reviewed the WS-ResourceLifetime specification that standardizes two means by which a requestor can terminate WS-Resources: immediate and scheduled termination.
Finally, we finished our review of the WS-Resource Framework by summarizing three other specifications that will be completed and published soon.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.