Skip to end of metadata
Go to start of metadata

The XSD sequencer included in ModeShape can parse WSDL files that adhere to the W3C's Web Service Definition Language (WSDL) 1.1 specification, and output a representation of the WSDL file's messages, port types, bindings, services, types (including embedded XML Schemas), documentation, and extension elements (including HTTP, SOAP and MIME bindings). This derived information is intended to mirror the structure and semantics of the actual WSDL files while also making it possible for ModeShape users to easily navigate, query and search over this derived information. This sequencer captures the namespace and names of all referenced components, and will resolve references to components appearing within the same file.

The design of this sequencer and it's output structure have been influenced by the SOA Repository Artifact Model and Protocol (S-RAMP) draft specification, which is currently under development as an OASIS Technology Committee. S-RAMP defines a model for a variety of file types, including WSDL and XSD. This sequencer's output was designed to mirror that model, and thus some of the properties and node types used are defined within the "sramp" namespace. However, the structure derived by the ModeShape WSDL sequencer is a superset of that defined by S-RAMP.

The WSDL specification allows for a fair amount of variation in WSDL files, and consequently this variation is reflected in the derived output structure.

ExampleLet's look at an example WSDL file from the WSDL 1.1 specification:

This WSDL definition includes an embedded XML Schema that defines the structure of two XML elements used in the web service messages, and it defines a 'StockQuotePortType' port type with input and output messages, a SOAP binding, and a SOAP service. The WSDL sequencer will derive from this file the following content:

The first thing to note is that the sequencer produces a node of type wsdl:wsdlDocument that includes the mode:derived information (e.g., the time of sequencing and the path to the file from which this information was derived), and information about the WSDL file itself. If the WSDL file contained documentation elements directly under the root element, the content of those elements would have been placed inside an sramp:description property.

Secondly, the WSDL file contains an embedded XML Schema document, and this XSD was sequenced also. See the XML Schema sequencer documentation for the structure of the XML Schema documents. Any references to the XSD components in the embedded schema(s) will be captured as REFERENCE properties as well as properties containing the local name and namespace of the components.

Thirdly, there are several "container" nodes underneath the top-level wsdl:wsdlDocument node, and are named wsdl:messages, wsdl:portTypes, wsdl:bindings, and wsdl:services. These container nodes serve to separate out the various kinds of definitions, since per the WSDL 1.1 specification the name scope of each kind of component is distinct from the other kinds.

Within the wsdl:messages container node are all of the messages. In this case, there are two: the "GetLastTradePriceInput" input message and "GetLastTradePriceOutput" output message for the "GetLastTracePrice" operation defined a bit later in the structure. Note how these messages contain the name, namespace URI, and REFERENCE to the corresponding element node in the embedded schema content. (If the element reference could not be resolved, REFERENCE property would not be set.)

Within the wsdl:portTypes container node are all of the port types. In this example, there is just one: the "StockQuotePortType" that contains a single "GetLastTradePrice" operation. Here, the operation's input and output reference the corresponding message nodes vi the name, namespace URI, and REFERENCE property. Again, the REFERENCE property would not be set if the input and/or output use a message that is not in this WSDL file.

Within the wsdl:bindings container node are all of the bindings defined in the WSDL. In this example, there is just a single binding that uses SOAP extensions, which describe all of the SOAP-specific information for the port type. The sequencer also supports HTTP and MIME extensions. And node how the input, output and faults of each binding operation reference (using the name, namespace URI, and REFERENCE properties) the corresponding input, output and fault (respectively) in the correct port type.

Finally, within the wsdl:services container node are all of the services defined in the WSDL. In this example, there is just a single SOAP service that references the "StockQuotePortType" port type.

This example shows the basic structure this sequencer derives from WSDL 1.1 files. Not only does this structure mirror that of the actual WSDL file, but it makes this structure easy to navigate, search and query, especially when it includes the names and namespace URIs of the referenced components (and setting REFERENCE properties to the referenced component where possible).

Node TypesThe WSDL 1.1 sequencer follows JCR best-practices by defining all nodes to have a primary type that allows any single or multi-valued property, meaning it's possible and valid for any node to have any property (with single or multiple values). This sequencer doesn't add any such properties or nodes, but you are free to annotate the structure as needed.

The compact node definitions for the "wsdl" namespace are as follows:

These types use some of the node types and mixins defined in the "sramp" namespace:

ConfigurationTo use this sequencer, simply include the appropriate version of the Maven artifact with a "org.modeshape" group ID and "modeshape-sequencer-wsdl" artifact ID. Or, if you're using JAR files and manually setting up the classpath for your application, use the "modeshape-sequencer-wsdl-2.7.0.Final-jar-with-dependencies.jar" file. Then, define a sequencing configuration in the ModeShape configuration, using something similar to:

or using the JcrConfiguration:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.