WSDL 2.0 Component Model - Test

This section provided a tutorial example on how to create a WSDLReader to parse a WSDL 2.0 document into WSDL component objects.

To see how the Component model works, I wrote this testing program to parse my WSDL 2.0 document, Hello_WSDL_20_SOAP.wsdl, into components:

 * Copyright (c) 2009 by Dr. Herong Yang,
 * All rights reserved
import org.apache.woden.WSDLFactory;
import org.apache.woden.WSDLReader;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.Service;
import org.apache.woden.wsdl20.Binding;
import org.apache.woden.wsdl20.Interface;
import org.apache.woden.wsdl20.InterfaceOperation;
import org.apache.woden.wsdl20.ElementDeclaration;
import org.apache.woden.wsdl20.TypeDefinition;
class WodenHelloComponent {
   public static void main(String[] args) {
      PrintStream out = System.out;
      String wsdl = "file:///C:/herong/Hello_WSDL_20_SOAP.wsdl";

      try {
// Loading the WSDL 2.0 document
         WSDLFactory wFactory = WSDLFactory.newInstance();
         WSDLReader wReader = wFactory.newWSDLReader();
         wReader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
         Description wDescription = wReader.readWSDL(wsdl);

// Implementation class information
         out.println("Reader object: "
         out.println("Description object: "

// Getting WSDL 2.0 document components
         Service[] serviceList = wDescription.getServices();
         out.println("First service name: "
         Binding[] bindingList = wDescription.getBindings();
         out.println("First binding name: "
         out.println("First binding type: "

         Interface[] interfaceList = wDescription.getInterfaces();
         out.println("First interface name: "

         InterfaceOperation[] operationList 
            = interfaceList[0].getInterfaceOperations();
         out.println("First operation name: "
         out.println("First operation pattern: "
         out.println("First operation style: "
         ElementDeclaration[] elementList 
            = wDescription.getElementDeclarations();
         out.println("# of element declarations: "
         out.println("First element name: "

         TypeDefinition[] typeList 
            = wDescription.getTypeDefinitions();
         out.println("# of type definitions: "
         out.println("First type name: "
      } catch (Exception e) {

Result of this test program is listed below:

C:\herong>\local\jdk\bin\java -Djava.ext.dirs=\local\axis2\lib\

Reader object: org.apache.woden.internal.DOMWSDLReader
Description object: org.apache.woden.internal.wsdl20.DescriptionImpl
First service name: {}helloService
First binding name: {}helloBinding
First binding type:
First interface name: {}helloInterface
First operation name: {}Hello
First operation pattern:
First operation style:
# of element declarations: 2
First element name: {}HelloResponse
# of type definitions: 44
First type name: {}ENTITIES

No surprises, except the list of type definitions. My WSDL document does not define any types explicitly. But WSDL 2.0 automatically inherited 44 types defined in the XML Schema.

Last update: 2009.

Table of Contents

 About This Book

 Introduction to WSDL 2.0

 WSDL 2.0 Document Structure and Syntax

 WSDL Version 2.0 Part 2: Adjuncts

 WSDL 2.0 Document Examples with SOAP Binding

WSDL 20 Programming APIs and Testing Tools

 List of APIs and Tools

 ServiceClient Class Loading WSDL 2.0 Documents

  WSDL2Java Converting WSDL 2.0 Documents to Stub Classes

 What Is Woden 1.0?

 WSDL 2.0 Component Model

WSDL 2.0 Component Model - Test

 WSDL 2.0 Element Model

 WSDL 2.0 Element Model Test

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

 soapUI 3.0.1 - Web Service Testing Tool

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension in PHP 5.3.1

 Using WSDL in Perl with SOAP::Lite 0.710

 Using WSDL Document in Java with Axis2 1.4.1

 Using WSDL2Java to Generate Web Service Stub Classes

 WSDL 1.1 Binding Extension for SOAP 1.2

 WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

 SOAP 1.2 Binding - PHP, Java and Perl Clients

 WSDL Related Terminologies


 PDF Printing Version