Web Services
  Home arrow Web Services arrow Page 3 - Introducing the Implied Resource Pattern
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

Introducing the Implied Resource Pattern
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2006-07-06

    Table of Contents:
  • Introducing the Implied Resource Pattern
  • Modeling Resource Properties
  • Resource Property Operations
  • GetResourceProperty
  • QueryResourceProperties
  • SetResourceProperties
  • Combining the SetResourceProperties Components

  • 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


    Introducing the Implied Resource Pattern - Resource Property Operations


    (Page 3 of 7 )

    WS-ResourceProperties defines four operations related to querying and updating resource properties values: GetResourceProperty, GetMultipleResourceProperties, QueryResourceProperties, and SetResourceProperties. These provide simple, standardized access to the resource properties values of a WS-Resource. Nothing prevents the designer from specifying additional operations that also read or change the WS-Resource's state. However, by defining simple, standardized access, WS-ResourceProperties enables common tooling and better composability of Web services. Let's examine how SkatesTown uses these operations.

    Although these operations are defined in the WS-ResourceProperties specifications, SkatesTown includes them in its WSDL definition of its POPortType definition by copying and pasting the WSDL operations. Of course, SkatesTown uses the WSDL import element to allow these copied operations to refer to the WSDL messages and other WSDL elements defined by WS-ResourceProperties. Listing 8.2 shows the new POSubmission WSDL, which incorporates the WS-ResourceProperties concepts.

    Listing 8.2 ResourceProperties Operations in the POPortType

    <?xml version="1.0" ?>
    <wsdl:definitions name="PurchaseOrder"
    targetNamespace=
    "http://www.skatestown.com/services/interfaces/
    poResource.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:po="http://www.skatestown.com/ns/po" xmlns:poR="http://www.skatestown.com/services/
    interfaces/poResource.wsdl" xmlns:poRP="http://www.skatestown.com/ns/
    poResourceProperties" xmlns:inv="http://www.skatestown.com/ns/invoice" xmlns:wsrp="http://www.ibm.com/xmlns/stdwip/
    web-services/WS-ResourceProperties" xmlns:wsrl="http://www.ibm.com/xmlns/stdwip/
    web-services/WS-ResourceLifetime" xmlns:soap="http://schemas.xmlsoap.org/wsdl/
    soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <wsdl:import namespace= "http://www.ibm.com/xmlns/stdwip/web-services/
    WS-ResourceProperties" .../> <wsdl:import namespace= "http://www.ibm.com/xmlns/stdwip/web-services/
    WS-ResourceLifetime" ... /> <!-- Type definitions --> <wsdl:types> <xsd:schema targetNamespace= "http://www.skatestown.com/services/
    interfaces/poResource.wsdl"> ... <xsd:element name="ErrorMessage"
    type="xsd:string" /> <xsd:element name="POResourceID"
    type="xsd:positiveInteger" /> </xsd:schema> </wsdl:types> <!-- Message definitions --> <wsdl:message name="ErrorMessage"> <wsdl:part name="ErrorMessage"
    element="poR:ErrorMessage"/> </wsdl:message> <wsdl:message name="GetInvoiceRequest" /> <wsdl:message name="GetInvoiceResponse" > <wsdl:part name="GetInvoiceRequest"
    element="inv:invoice" /> </wsdl:message> <!-- Port type definitions --> <wsdl:portType name="POPortType" wsrp:ResourceProperties=
    "poRP:poResourceProperties"> <wsdl:operation name="getInvoice"> <wsdl:input name="GetInvoiceRequest" message="poR:GetInvoiceRequest" /> <wsdl:output name="GetInvoiceResponse" message="poR:GetInvoiceResponse" /> <wsdl:fault name="NoInvoiceFault" message="poR:ErrorMessage" /> </wsdl:operation> <!-- ========== extends wsrp:GetResourceProperty
    ============ --> <wsdl:operation name="GetResourceProperty"> <wsdl:input name="GetResourcePropertyRequest" ... </wsdl:operation> <!-- ===== extends
    wsrp:GetMultipleResourceProperties ======= --> <wsdl:operation name=
    "GetMultipleResourceProperties"> <wsdl:input name=
    "GetMultipleResourcePropertiesRequest" ... </wsdl:operation> <!-- ===== extends wsrp:SetResourceProperties
    ============ --> <wsdl:operation name="SetResourceProperties"> <wsdl:input name=
    "SetResourcePropertiesRequest" ... </wsdl:operation> <!-- ======= extends wsrp:QueryResourceProperties
    =========== --> <wsdl:operation name="QueryResourceProperties"> ... </wsdl:operation> </wsdl:portType> </wsdl:definitions>

    This WSDL shows the definition for the POPortType. This definition combines an application-specific operation (GetInvoice) with WS-ResourceProperties–specific operations copied from the WS-ResourceProperties WSDL.

    We can examine the details of the WS-ResourceProperties operations in the context of a PurchaseOrder WS-Resource instance. In particular, we can examine the situation where the client, The Skateboard Warehouse, has a WS-Resource–qualified endpoint reference, as shown in Figure 8.1, that it got in response to an invocation of SkatesTown's POSubmission service. The WS-Resource pointed to by that endpoint reference has resource property values as shown in Listing 8.1.

    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). Check it out today at your favorite bookstore. 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 5 hosted by Hostway
    Stay green...Green IT