Woden4SAWSDL Tutorial

This document provides a quick overview of how to use the Woden4SAWSDL object model. This includes code samples showing how to kickstart the usage of Woden4SAWSDL

A word about the origins

This object model is built using on the Woden object model from Apache Software Foundation.

Starting up - what you need

The following jar files are needed in the classpath in order to use Woden4SAWSDL

A more comprehensice dependency report is available in the dependencies page which includes the version numbers. If you plan to start from scratch with the source then please read the building from source section.

The API

The SAWSDL specification focuses on the following elements Since the woden API has been developed with component extensions in mind, adding an extesnion such as SAWSDL is quite straightforward. However some of the extension mechanisms were not complete and hence some modifications were needed in the woden code to produce the desired results. Also since woden uses Apache WS-Commons XmlSchema, some extensions were added to the XmlSchema parser as well.

A Word About Utilities

Since some operations such as creating a declarations object need a sequence of operations, A utility class has been provided for convenience. The subsequent code samples in this document assume the use of this utility class. The readers however are free to 'get their feet wet'

Creating Declaration Objects

The following code segment shows how a SAWSDL definition object can be constructed
                
                     Description description = edu.uga.cs.lsdis.wsdl20.utilSAWSDLUtil.getDescription(url);
                
            
Note the variable url holds the full path of the .WSDL file.

Accessing Other Specialized Objects

Once the definition object is aquired, one can easily navigate to the other semantically annotated objects. The following code segement shows how one can retrieve the model references in the Interface.
                
                    Description d = getDescription();
                    Interface[] interfaces = d.getInterfaces();
                    ModelReference modelRef = SAWSDLUtil.getModelRef(interfaces[0])
                
            
The getDescription() method returns Declaration object. The modelRef object can be used to obtain the list of model reference URI's

Handling schema

Schema Handling is very similar and simpler in this Woden4SAWSDL. The following code fragment shows how to extract model references in an element declaration
                
                    Description d = getDescription();
                    ElementDeclaration elDecl = d.getElementDeclaration
                    (new QName("http://myns", "myElt"));

                    ModelReference mref = SAWSDLUtil.getModelRef(elDecl);
                
            
Note that http://myns and myElt are the namespace and the localname respectively of the element in question. A similar method can be applied to types.
                
                    Description d = getDescription();
                     TypeDefinition definition = desc.getTypeDefinition
                    (new QName("http://myns", "myType"));

                    ModelReference mref = SAWSDLUtil.getModelRef(definition);
                
            
There are respective methods in SAWSDLUtil class that can be used to extract lifting and lowering mappings too. The following examples show how to use the Utiliy methods to obtain such mappings.
                
                    Description d = getDescription();
                     TypeDefinition definition = desc.getTypeDefinition
                    (new QName("http://myns", "myType"));

                    SchemaMapping schemaMapping = SAWSDLUtil.getLifingMapping(tDec);
                
            
The schema mapping object contains a similar list of URI's as of the model Reference.

Conclusion

Woden4SAWSDL is a simple API that allows easy handling of SAWSDL documents