Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Autonomic computing tip: So you are building a WSDM interface

Design a WSDL to translate httpd concepts

Kane Scarlett (kane@us.ibm.com), developerWorks Editor, Federated Integration Test team, IBM China Development Lab 
Kane Scarlett
Kane Scarlett is the editor of the Autonomic computing technology zone for developerWorks. His past publishing work was with such magazines as Unix Review, Advanced Systems, and the -World publications (Java-, Sun-, NC-, Linux-), as well as some little oddball journals like National Geographic Magazine.

Summary:  When you're building a Web Services Distributed Management (WSDM)-compliant interface for a manageable resource with Apache Muse, these four simple steps will guide you in designing the necessary Web Services Description Language (WSDL).

View more content in this series

Date:  20 Mar 2007
Level:  Intermediate

Activity:  505 views
Comments:  

When you're using Apache Muse to create a WSDM-compliant interface for a manageable resource, what steps should you follow to design your Web Services Description Language so you can translate httpd concepts into those in the WS-Resource Framework (WSRF) and WSDM specifications?

  1. Understand the state model (resource properties document).
  2. Decide which resource operations the Web services interface should have.
  3. Use the template WSDL provided by the Muse SDK to build the actual WSDL XML document.
  4. Add the resource properties and operations that are specific to HTTP servers.

So you want to plan and build a WSDM interface

These steps are from "Creating a WSDM interface for an HTTP server using Apache Muse," in which you'll learn how Apache Muse can be used to create a WSDM-compliant interface for a manageable resource; more specifically, how to design the Web service interface for the resource, generate code for the implementation, and deploy the code as a Web application. (For more resources on crafting a WSDM interface, see the sidebar.)

Resource properties

First, understand the state model (resource properties document), the first part of any WSRF-based WSDL. All Web services that are based on WSRF must have a resource properties document:

  • WSRF and WSDM both define a number of standard properties (many of which are optional) that are useful to managed resource developers. Like ResourceId (a unique identifier for each instance of a resource type); ManageabilityCapability (a collection of URIs communicates to remote clients what management features the Web service supports); Caption, Description, and Version (provides human-readable text that help management clients sort and present the resources more clearly); and OperationalStatus (a simple enumeration that gives a high-level report on the resource's ability to service requests using the values Available, PartiallyAvailable, Unavailable, and Unknown). These properties all revolve around the common themes of identification and description; their definitions and semantics will adhere to the standards.

  • There are also many pieces of information in the httpd installation that could be useful to a management client, things that are specific to HTTP servers (and all found in the httpd.conf file). Plus information that you wouldn't want exposed using Web services, so every property in httpd.conf shouldn't be considered a resource property. Three HTTP properties to focus on include ThreadsPerChild (the number of request-handling threads in each httpd process), Listen (the port number that the server is listening on), and ServerName (the full host name and port that the server uses to identify itself).

Resource operations

Decide which resource operations the Web services interface should have. They're used to manipulate the state model and also come in two flavors:

  • WS-* operations. The minimal set of operations required by WSRF has just one operation -- GetResourceProperty (or GetResourcePropertyDocument and GetMultipleResourceProperties depending on how much information you want to get). Another good one to add to the list is GetMetadata, which provides a robust way for clients to resolve a resource's WSDL document.

  • HTTP operations like Start and Stop are really necessary because a management client would most probably need to control the availability of the server if it were in charge of maintaining and optimizing it. These two operations can be mapped to the execution of the httpd application and termination of the same process, respectively.

Take 1 and 2 and make an actual XML document

Use the template WSDL provided by the Muse SDK to build the actual WSDL XML document for the httpd resource based on Steps 1 and 2; the template includes the WS-* definitions you need. You can customize it by:

  1. Give the WSDL file a meaningful name, such as "http-server.wsdl".
  2. Use your text editor to perform a search-and-replace on the current target namespace (http://ws.apache.org/muse/test/wsrf). Change the namespace to http://www.example.com/http-server.
  3. Use your text editor to perform a search-and-replace on the current WSDL name (WsResource). Change the name to HttpServer.
  4. At the bottom of the WSDL, change the location attribute on the <wsdl-soap:address/> element to be http://localhost:8080/http-management/services/http-server.
  5. Delete all of the resource properties that are not being used by your httpd resource. These include CurrentTime, TerminationTime, QueryExpressionDialect, and the four topic-related properties.
  6. Delete all of the <wsdl:message/> and <wsdl:operation/> elements that are not being used by your httpd resource. These include QueryResourceProperties, SetResourceProperties, Subscribe, and GetCurrentMessage.

Don't forget HTTP-specific stuff

Finally, add the resource properties and operations that are specific to HTTP servers.

Hint: Don't confuse having no type ("void" in Java™ code) with allowing open content. The latter requires a type of xsd:anyType. Muse's code generation tool will map parameters of xsd:anyType to the org.w3c.dom.Element type from the JDK, giving you the raw XML content to work with in your Java method. If you don't want any parameters, leave the type blank.

Your WSDL is complete.


Resources

Learn

Get products and technologies

Discuss

About the author

Kane Scarlett

Kane Scarlett is the editor of the Autonomic computing technology zone for developerWorks. His past publishing work was with such magazines as Unix Review, Advanced Systems, and the -World publications (Java-, Sun-, NC-, Linux-), as well as some little oddball journals like National Geographic Magazine.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Tivoli, SOA and web services
ArticleID=202608
ArticleTitle=Autonomic computing tip: So you are building a WSDM interface
publish-date=03202007