Home arrow Web Services arrow Page 5 - Introducing the Implied Resource Pattern
WEB SERVICES

Introducing the Implied Resource Pattern


This article continues our discussion of the WS-Resource Framework, a set of proposed standards that formalizes the relationship between Web services and state. In this part, the second of a multi-part series, we start with the implied resource pattern. 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).

Author Info:
By: Sams Publishing
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
July 06, 2006
TABLE OF CONTENTS:
  1. · Introducing the Implied Resource Pattern
  2. · Modeling Resource Properties
  3. · Resource Property Operations
  4. · GetResourceProperty
  5. · QueryResourceProperties
  6. · SetResourceProperties
  7. · Combining the SetResourceProperties Components

print this article
SEARCH DEVARTICLES

Introducing the Implied Resource Pattern - QueryResourceProperties
(Page 5 of 7 )

The QueryResourceProperties operation was designed to allow applications to issue query expressions, like XPath, against the content of a WS-Resource's resource property document. Although the syntax of QueryResourceProperties allows for any type of query expression, the normal usage is for an XPath version 1.0 expression to be evaluated on the resource properties document. The form of the query element is

<wsrp:QueryExpression dialect="URI">
xsd:any
</wsrp:QueryExpression>

And the language used in the content of the query is indicated by the URI value of the dialect attribute. The WS-ResourceProperties specification defines two expression dialect URIs: XPath 1.0 (http://www.w3.org/TR/1999/REC-xpath-19991116) and XPath 2.0 (http://www.w3.org/TR/2003/WD-xpath20-20031112).

Imagine if The Skateboard Warehouse had a collection of outstanding PurchaseOrder WS-Resources, some with SkatesTown and some with other vendors. Although it could group these WS-Resource references together into a collection (such as a ServiceGroup that we'll briefly discuss toward the end of this chapter), imagine for now that the reorder application simply keeps an array of WS-Resource endpoint references to these PurchaseOrder WS-Resources. Now, consider the case where a decision maker wants to get a list of all the pending PurchaseOrders. The application could iterate through the array of endpoint references, issuing the following XPath 1.0 Query:

<soap:Envelope>
...
  <!--identify the resource from the EPR -->
<poRP:POResourceID>XXXXX</poRP:POResourceID>
</soap:Header> <soap:Body> <wsrp:QueryResourcePropertiesRequest> <wsrp:QueryExpression dialect="http://www.w3.org/TR/1999/
REC-xpath-19991116"> ./poRP:status="pending"
</wsrp:QueryExpression> </wsrp:GetMultipleResourcePropertiesRequest> </soap:Body> </soap:Envelope>

The application would then aggregate the responses from the query evaluation on each PurchaseOrder WS-Resource. In the case of the PurchaseOrder we've been examining in this section, the status is received, not pending; therefore the response will be

<soap:Envelope
...
 <poRP:POResourceID>43871</poRP:POResourceID>
</soap:Header> <soap:Body> <wsrp:QueryResourcePropertiesResponse> false </wsrp:QueryResourcePropertiesResponse> </soap:Body> </soap:Envelope>

Currently, there is no way for the Web service to communicate which query languages it supports. It would need to be declared using some WS-Policy assertion, but WS-ResourceProperties doesn't specify this WS-Policy grammar.


blog comments powered by Disqus
WEB SERVICES ARTICLES

- Dealing with Loose Coupling in a Service-Ori...
- Loose Coupling in a Service-Oriented Archite...
- Safety, Idempotence, and the Resource-Orient...
- The Resource-Oriented Architecture in Action
- Features of the Resource-Oriented Architectu...
- The Resource-Oriented Architecture
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials