HomeDigital EditionSys-Con RadioSearch Web Services Cd
B2B Beginning WS Business Process Management Case Studies Content Management Distributing Computing e-Business Electronic Data Interchange Enterprise Industry Insight Integration Interviews Java & Web Services .NET Portal Product Reviews Scalability & Performance Security SOAP Source Code UDDI Wireless WS Standards WS Tips & Techniques WSDL WS Editorials XML

Tools for Taming Web Services Management

Source Code for this article

As Web services move beyond opportunistic implementations and proof-of-concept deployments to support enterprise-wide services in mission-critical applications, the need for Web services management becomes ever more pressing. While Web services present a tremendous opportunity for organizations to improve coordination and integration both within the enterprise and with old and new business partners, dealing with a multitude of partners with changing requirements in an open heterogeneous environment also provides new opportunities for failure. These problems can be mitigated through the use of policies representing proper procedures and best practices. It is the role of Web services management to allow users to choose procedures, establish best practices, and then enforce them in real time.

I will discuss the touch points for applying these policies and some means of organizing them so your Web Services Management Platform (WSMP) doesn't become, itself, unmanageable. We use two organizational techniques for this: service views, a way of organizing Web service operations for different audiences; and policy groups, a way of organizing policy decisions applicable to multiple operations. First we will show how management concerns arise from an examination of Web service messages and then show how these two concepts provide an effective means of organizing management policies.

Web Services Management Areas of Concern
In choosing what to manage, there is an inevitable trade-off between processing that happens in the manager and processing that happens in the Web service. At one end is information that must be tracked globally for the whole network to function, or policies that must be consistently applied across many services. At the other is processing that is more application specific, but more easily handled by the manager and can insulate the application from changes, such as transformations into and out of standard formats. Perhaps the best way to show the many ways management can impact message processing and provide stability is to observe the handling of a message or two by a Web Services Manager. Listing 1 presents a short Web service message - in particular, a Simple Object Access Protocol (SOAP) message. Looking at this message, we can ask a number of WSM-related questions:

  • Mitigating outside attacks: Along with the message, we have the (alleged) IP address of the originator. How many times has this IP attempted to access this service? Have there been a slew of unsuccessful attempts indicating an attempt to break into this service or related ones? Should we block this IP? Should we shut down the service? Who do we inform?
  • Information security (encryption/signature): The message contains a WS-Security header block indicating a signature for certain parts of the document. Who signed these elements? Where is the Certificate Authority (CA) for this signature? Is there critical information that hasn't been signed? Is there information that needs to be encrypted given its source or destination? If we need to sign/encrypt it, which key do we use?
  • Access control: Who is this message from/ to? How do we identify them? Are they allowed to access the service they are contacting? Once we identify them, do we need to switch credentials to access the ultimate service? Do we need to filter information in the Web service's response? If they have no access rights, who do we inform?
  • Metering/resource management: Is there a cost to access this service? What account should be used? How much do we charge?
  • Quality of service and service-level agreements: Is the service up? What is its response time? Given two simultaneous requests, which is serviced first?
  • Quality assurance: Is the message valid according to its schema? If I've transformed the message, is the new message valid? Do the values make sense? Is it the expected response?
  • Standards implementation and conformance: Because SOAP itself allows so much variability, other groups, such as WS-I, have specified best practices for conforming SOAP messages. Is this a SOAP message? Is it SOAP1.1 or SOAP1.2? Is it WS-I Basic Profile compliant?
Because of the heterogeneity of the network and the variety of clients that need to access an ever-burgeoning list of Web services, the answers to these questions can vary considerably depending on who (requestor) is sending what (message) over the network (channel) to whom (receiver/base service). This tuple (sender, message, channel, receiver) is the key to these different answers. Any set of answers represents a policy, a specification of how your system will react to a particular set of circumstances.

The sheer amount of work required to support the entirety of this agenda makes implementing a management capability on a Web service-by-Web service basis prohibitively expensive. Clearly the work required to build a management capability from scrap far overshadows the cost of implementing any single Web service.

Organizing Policies and Services
XML provides the possibility to directly examine and operate on the message stream, and many common policies require examining, if not actively manipulating, the message. Therefore, WSMPs tend to use an intermediary or broker architecture; messages between the requestor and the base service first pass through the manager. The manager sees a sequence of structured messages from a particular network port destined for another network port. While it is possible to design policies exclusively at the message level, this inevitably leads to diminishing returns. In a complex environment, the set of if-then-else conditions to first determine the (sender, message, channel, receiver) tuple and then answer our list of questions will be torturously complex. With no abstraction level above the message, all the decision logic must be specified explicitly, while a more abstract view would answer many of them implicitly. Additional layers up the stack include the operation level, the port level, the service level, and even, in the other direction, the XML element level. In addition to messages, there are the requestors to consider as well. Service views and policy groups are two techniques to organize these various levels according to the changing requestor/message/channel/operation mix so they can be managed in concert, rather than in conflict, in a way that simplifies rather than complicates.

The key standard for organizing Web services is the Web Services Description Language (WSDL). WSDL organizes operations by endpoint and specifies the structures for messages to those endpoints. It has also become the focal point for specifying other information about services. A <definition> element contains a list of services, ports, bindings, and operations. Nevertheless, what may appear as a logical organization of operations from the developer's viewpoint may no longer be so when looked at from other perspectives. Different sets of users will be allowed access to different sets of operations with different access rights using different authentication mechanisms. Mixing all of these in a single WSDL is dangerous.

But there's no reason to see a WSDL <definition> as universally valid. We can treat a WSDL <definition> element as a protocol for a provider to communicate a permitted set of operations and policies to a specific set of users. Internally, we can link a given <definition> with a particular set of policies about messages, ports, and operations. We take a particular set of (sender, message, channel, receiver) decisions about some set of services and formulate those as a set of policies. From those policies we generate a <definition> element reflecting those policies, and send it to the particular requestors to whom we wish to apply those policies. The <definition> can therefore serve as a tool for management and a mechanism for conveying policies, with different sets of users receiving different WSDLs, even with different addresses, although the underlying operations may be the same.

We call each of these a service view by analogy to the database view of SQL. In many ways, this is an extension of the WSDL <binding>, which provides for multiple serialization formats for Web services messages, depending on the characteristics of the recipient. Another analogy is to interfaces in traditional programming languages, such as Java. In Java, a single object can support any number of interfaces, with each different interface including a subset of the methods of the class. A client object sees another object by the interface provided, without knowing about the underlying class and any other methods available.

For example, in Listings 2a and 2b we see abbreviated WSDL for two services - purchase orders and support - where there may be a variety of clients, or service requestors, some internal to the organization and some external. Both services, though, are designed for internal customers.

In Listings 3a and 3b we can see two different service views of these operations. In each case we've organized a subset of the operations into a single port with a new address, combining operations from both underlying services. Immediately we've divided our users into two groups that will access different mixes of our underlying base services through different routes. In Listing 3a, the "AcmeSpecialService", authentication is specified by adding username and password fields. This is accomplished differently for the RPC- style SubmitIssue from the document-style SendPurchaseOrder. In the first case, extra parts can be inserted directly into the message. In the second, because everything needs to tie back to a W3C schema, we create a new namespace to house the extra elements and then add them to the message. In Listing 3b, the clearly more sophisticated ZenithSpecialService, we've added features. For example, we've added a WS-Security header to the mix, specifying the use of WS-Security as the access mechanism. This also requires importing the WS-Security schema. We've added a WS-I Basic Profile (BP) conformance claim and associated header. But because BP doesn't support RPC encoding, a document-style equivalent needs to be generated (including a new schema corresponding to the namespace). These indicate different levels of integration, depending on the sophistication of the clients.

In essence, the service view allows a constellation of concerns - service requestors, operations, formatting, authorization, and authentication - to be unified in a single view. While the number of different combinations of these is astronomic, in reality there will be very few. With a service view, the actual combinations can be brought together and easily managed by a set of consistent policies. The original service, now hidden behind and protected by the view, remains the same. Other policies not directly describable by the WSDL can still be segregated by view. For example, the authentication mechanism used can be assigned on a per-view basis. Then policies regarding requestors from a particular location - such as Acme - need only be tested for messages coming to specified ports - as only requestors from the targeted group will be authenticated.

The other organizing principle, the policy group, provides a mechanism to specify policies applying to operations in multiple views, or to a subset of a view. For example, a service view can provide a mapping from requestor to role, but the rights granted to a role may be linked to the underlying operation and be consistent across views. A role can be used to control access to operations within a view (in a traditional access control fashion) or enable content-filtering policies to control the content of a message (limiting the size of a purchase order is a commonly used example).

Additionally, there may be policies applicable to a variety of operations, regardless of which views they appear in. A policy that cuts across both service view and policy groups would be a policy to prevent a requestor from seeing information concerning other organizations. The Web service in Listing 3b allows customers at Zenith access to the ListOpenIssues operation. A logical policy would be to restrict Zenith to viewing only its own issues, but the underlying operation may not be able to do so. A policy employing a filter could implement this for the Zenith view, but a more general policy would be to apply this restriction to any organization with access to the underlying operation. This can be implemented by a filter to stop the message, or a transformation to excise the information. The policy would apply across many operations, but the identity of the requesting organization comes from the view. As different operations have different structure, the filter or transformation would need to be attached to the underlying operation. The policy would be applied across all operations, using either a service view-supplied organization name and the operation-specific filter or information from the incoming message. Were these not present, the policy would fail.

At present there is no uniform way to describe the variety of policies that may be applied to Web services. WS-Policy, a set of proposals related to WS-Security, may provide a means for naming the policies being applied to a particular service view; however, policy implementation will undoubtedly remain proprietary to different Web service management products. The degree to which they are automated will also vary from WSMP to WSMP.

Conclusion
I've described a number of practical issues related to forming effective policies for managing Web services as messages flow back and forth. Given the large number of these and the multitude of ways they can interact, we've described two mechanisms, service views and policy groups, that provide an effective means of organizing policies into different coherent groups and reflecting those groups out to partners as WSDL. By presenting different specific WSDLs to different groups, an organization can succeed in controlling the cacophony of different agreements and capabilities of many partners, as well as insulating the underlying base services from the filtering, authentication, authorization, and other ancillary processing performed at the management layer.

The field of Web services management is still in the early stages, but already it has shown itself to be a complex area requiring new techniques beyond previous management tools. New complexity generally requires new abstractions to reorganize information and keep it from degenerating into chaos; service views and policy groups are techniques to control the additional requirements and possibilties of Web services. Without this, Web services themselves will become a drain on the organizations that deploy them. But they sit at the bottom of a new stack of management issues surrounding Web services. Above this are other exciting areas, such as business process orchestration and real-time business intelligence. What new techniques will be added to the list will become apparent as this technology moves to maturity.

About the Author
Dr. Matthew Fuchs is a member of the technical staff at Westbridge Technology. Previously, he was chief scientist for XML Technologies at Commerce One, and pioneered the theory and practice of using domain-specific languages in XML and SGML for distributed applications and agent-oriented communication over the Internet. At Commerce One he developed a variety of XML technologies, including SOX, the first implemented, publicly available, object-oriented Schema language and parser for XML.

Tools for Taming Web Services Management by Dr. Matthew Fuchs
WSJ Vol 04 Issue 01 - pg.22



Listing 1

POST /TradeSecurity.jws HTTP/1.1
Host: demo.westbridgetech.com
Connection: close
Accept: */*
Content-Length: 1255
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<SOAP-ENV:Envelope xmlns:SOAP-ENC=
"http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:impl="http://example.com/TradeSecurity.jws-impl"
   xmlns:intf="http://example.com/TradeSecurity.jws"
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header>
        <wsu:Timestamp
		xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
            <wsu:Created>2003-10-31T18:46:56Z</wsu:Created>
            <wsu:Expires>2003-10-31T18:47:06Z</wsu:Expires>
        </wsu:Timestamp>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
	SOAP-ENV:actor="http://tempuri.org/" SOAP-ENV:mustUnderstand="1">
	...
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
   <m:BuySecurity xmlns:m="http://example.com/TradeSecurity.jws"
   SOAP-ENV:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/">
            <tickerSymbol xsi:type="xsd:string">XXX</tickerSymbol>
            <amount xsi:type="xsd:string">1212</amount>
        </m:BuySecurity>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Listing  2a

<definition name="Support" targetNamespace="http://example.com/InternalSupport"
	xmlns:tns="http://example.com/InternalSupport"
	xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns="http://schemas.xmlsoap.org/wsdl/"
	xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
   <message name="SubmitIssueInput">
      <part name="contact" type="xsd:string"/>
      <part name="component" type="xsd:integer"/>
      <part name="description" type="xsd:string"/>
   </message>
   ...
   <portType name="Support">
      <operation name="SubmitIssue">
         <input message="tns:SubmitIssueInput"/>
	  ...
      </operation>
      <operation name="ListOpenIssues">
	...
	</operation>
	<operation name="AssignIssue">
	...
	</operation>
   </portType>
   <binding name="SupportBinding" type="tns:Support">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="SubmitIssue">
         <soap:operation soapAction="submit"/>
	  <input>
	     <soap:body use="encoded" namespace="http://example.com/Support" 
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
          </input>
			...
      </operation>
                ...
   </binding>
   <service name="SupportService">
      <port name="Support" binding="tns:SupportBinding">
         <soap:address location="http://internalserver/Support"/>
      </port>
   </service>
</definition>

Listing  2b

<definition name="Support" targetNamespace="http://example.com/PurchaseOrders"
   xmlns:tns="http://example.com/PurchaseOrder"
   xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns="http://schemas.xmlsoap.org/wsdl/">
   <types>
      <schema targetNamespace="urn:purchaseProcessing">
         <element name="PurchaseOrder"/>
      </schema>
   </types>
   <message name="PurchaseOrderInput">
      <part name="body" element="po:PurchaseOrder"/>
   </message>
   <portType name="OrderProcessing">
      <operation name="SendPurchaseOrder">
         <input message="tns:PurchaseOrderInput"/>
      </operation>
      <operation name="ChangeOrder">
         ...
      </operation>
      <operation name="CancelOrder">
         ...
      </operation>
   </portType>
   <binding name="POBinding" type="tns:OrderProcessing">
      <soap:binding style="document"
	  transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="SendPurchaseOrder">
         <soap:operation soapAction="send"/>
         <input>
            <soap:body parts="body" use="literal"/>
         </input>
         ...
      </operation>
      ...
   </binding>
   <service name="OrderProcessing">
      <port name="PurchasePort" binding="tns:POBinding">
         <soap:address location="http://internalserver/PurchaseOrders"/>
      </port>
   </service>
</definition>

Listing  3a

<definition name="Combined" targetNamespace=
"http://example.com/CustomerSupport"
	xmlns:tns="http://example.com/PurchaseOrder"
	xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns="http://schemas.xmlsoap.org/wsdl">
   <types>
      <schema targetNamespace="urn:purchaseProcessing">
         <element name="PurchaseOrder"/>
      </schema>
    <schema targetNamespace="http://example.com/identity">
         <element name="username" type="xsd:string"/>
         <element name="password" type="xsd:string"/>
      </schema>
   </types>
   <message name="PurchaseOrderInput" xmlns:id="http://example.com/identity">
      <part name="username" element="id:username"/>
      <part name="password" element="id:password"/>
      <part name="body" element="po:PurchaseOrder"/>
   </message>
   <message name="SubmitIssueInput">
      <part name="username" type="xsd:string"/>
      <part name="password" type="xsd:string"/>
      <part name="contact" type="xsd:string"/>
      <part name="component" type="xsd:integer"/>
      <part name="description" type="xsd:string"/>
   </message>
   <portType name="Combo">
      <operation name="SendPurchaseOrder">
         <input message="tns:PurchaseOrderInput"/>
         ...
      </operation>
      <operation name="SubmitIssue">
         <input message="tns:SubmitIssueInput"/>
         ...
      </operation>
   </portType>
   <binding name="binding" type="tns:Combo">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="SendPurchaseOrder">
         <soap:operation style="document" soapAction="send"/>
            <input>
               <soap:body use="literal"/>
            </input>
            ...
      </operation>
      <operation name="SubmitIssue">
         <soap:operation style="rpc" soapAction="submit"/>
         <input>
   <soap:body use="encoded" namespace="http://example.com/Support"
   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
         </input>
      </operation>
   </binding>
   <service name="AcmeSpecialService">
      <port name="AcmePort" binding="tns:Combo">
         <soap:address location="https://example.com/AcmeServices"/>
      </port>
   </service>
</definition>

Listing  3b:

<definition name="Combined" targetNamespace="http://example.com/ZenithServices"
xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
xmlns:tns="http://example.com/PurchaseOrder"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
   <types>
      <xsd:schema targetNamespace="urn:purchaseProcessing">
         <xsd:element name="PurchaseOrder"/>
      </xsd:schema>
      <xsd:schema targetNamespace="http://example.com/PurchaseOrders">
         <xsd:import namespace="http://schemas.xmlsoap.org/ws/2002/04/secext"/>
         <xsd:import namespace="http://ws-i.org/schemas/conformanceClaim"/>
      </xsd:schema>
      <xsd:schema targetNamespace="http://example.com/Support">
         <xsd:element name="SubmitIssue">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="contact" type="xsd:string"/>
                  <xsd:element name="component" type="xsd:integer"/>
                  <xsd:element name="description" type="xsd:string"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:schema>
   </types>
   <message name="PurchaseOrderInput">
      <part name="body" element="po:PurchaseOrder"/>
   </message>
   <message name="SubmitIssueInput">
      <part name="body" element="sup:SubmitIssue"/>
   </message>
   <message name="ws-security">
      <part name="header" element="wsse:Security"/>
   </message>
   <message name="wsi-basic">
      <part name="header" element="wsi:Claim"/>
   </message>
   <portType name="Combo">
      <operation name="SendPurchaseOrder"></operation>
      <operation name="SubmitIssue"> ... </operation>
      <operation name="ListOpenIssues"> ... </operation>
      <operation name="ChangeOrder"> ... </operation>
   </portType>
   <binding name="binding" type="tns:Combo">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="SendPurchaseOrder">
         <soap:operation style="document" soapAction="send"/>
         <input>
            <soap:body parts="body" use="literal"/>
            <soap:header message="tns:ws-security" part="header"/>
            <soap:header message="tns:wsi-basic" part="header"/>
         </input>
         ...
      </operation>
      <operation name="SubmitIssue">
         <soap:operation style="document" soapAction="submit"/>
         <input>
            <soap:body use="literal" namespace="http://example.com/Support"/>
         </input>
         ...
      </operation>
      ...
   </binding>
   <service name="ZenithSpecialServices">
      <port name="ZenithPort" binding="tns:Combo">
         <documentation>
            <wsi:Claim conformsTo="http://ws-i.org/profiles/basic/1.0"/>
         </documentation>
         <soap:address location="https://example.com/ZenithWebServices"/>
      </port>
   </service>
</definition>

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.

  E-mail: info@sys-con.com

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.