Writing WSDL

WSDL, short for Web Service Description Language, is an XML based language for describing the interface of web services. You can write WSDL definition in VP-UML with WSDL diagram. By combining with business process model, a full set of WSDL and BPEL can be generated.

Creating a WSDL diagram

A WSDL diagram is where you can create or edit a WSDL document. Different to other diagram types, WSDL diagram does not contain any shapes but the structure of WSDL document, and an editor for editing the document. To create a WSDL diagram, right click on WSDL Diagram in Diagram Navigator and select New WSDL Diagram from the popup menu.

To create a WSDL diagram
To create a WSDL diagram

This creates an empty WSDL diagram. To continue, you need to select any of the four methods listed below to locate the source of WSDL definition.

Different ways to select the source of WSDL definition
Different ways to select the source of WSDL definition
Method Description
1 Import the WSDL definition from a .wsdl file.
2 Import the WSDL definition from a URL of wsdl.
3 Select the WSDL definition that exists in your project.
4 Create a new definition by first selecting the definition type. Apache ODE (Orchestration Director Engine) and Oracle are both supported by VP-UML.

Then, click on either to create from a synchronous or asynchronous template. Different template selection will give a different document structure.
Synchronous - Once a synchronous process is being invoked, its business operations had to be completed before the invoking process move on.
Asynchronous - Once an asynchronous process is being invoked, the invoking process proceed with the asynchronous process in parallel without waiting it to complete.
Ways to select the source of WSDL

Alternative way to create WSDL diagram - from BPMN pool to WSDL

A process is the interactions between collaborators. Other than creating a WSDL diagram from diagram navigator, an alternative way is to create a from a pool (i.e. the collaborator) that initiate the process.

  1. Define the business process diagram of where the pool reside as BPEL diagram by right clicking on the background of diagram and selecting Diagram Type > BPEL from the popup menu. If you have done this before, ignore this step and move to step 2.
    Set diagram type to be BPEL
    Set diagram type to be BPEL
  2. Right click on the pool which initiate the process and select WSDL Diagram from the popup menu. Base on the type of process, and the type of workflow engine, select the appropriate option.
    Create WSDL diagram
    Create WSDL diagram
    Option Description
    Create ODE Synchronous
    Apache ODE (Orchestration Director Engine) is a kind of workflow engine supported by VP-UML. Select this option to create a WSDL diagram for a synchronous process that can be executed by ODE. Once a synchronous process is being invoked, its operations had to be completed before the invoking process move on.
    Create ODE Asynchronous
    Apache ODE (Orchestration Director Engine) is a kind of workflow engine supported by VP-UML. Select this option to create a WSDL diagram for an asynchronous process that can be executed by ODE. Once an asynchronous process is being invoked, the invoking process proceed with the asynchronous process in parallel without waiting it to complete.
    Create Oracle Synchronous
    Oracle workflow engine is a kind of workflow engine supported byVP-UML . Select this option to create a WSDL diagram for a synchronous process that can be executed by Oracle. Once a synchronous process is being invoked, its operations had to be completed before the invoking process move on.
    Create Oracle Asynchronous Apache ODE (Orchestration Director Engine) is a kind of workflow engine supported by VP-UML. Select this option to create a WSDL diagram for an asynchronous process that can be executed by Oracle. Once an asynchronous process is being invoked, the invoking process proceed with the asynchronous process in parallel without waiting it to complete.
    Description of options for creating WSDL diagram

Starting from a blank WSDL document...

If you create a blank WSDL diagram (document) there are some points that you need to pay attention to in order to create an executable definition.

  1. Take Oracle Synchronous as an example. Once selected, a WSDL diagram will be created, with a tree on the left hand side listing the WSDL file structure, and the Details pane on the right, where you can edit the chosen node in tree.
    WSDL diagram is created
    WSDL diagram is created
  2. Those fields labelled red in Details pane are fields that you must enter in order to export BPEL. One of them is the Target Namespace field of the root wsdl:definition node. Things that you will name in the WSDL definition (e.g. a message, portType) will automatically becomes part of the target namespace.
    Defining target namespace
    Defining target namespace
  3. Navigate through the tree and edit the nodes in it. Some of the properties are preset, but you can change them. Again, do remember that the red fields are compulsory. For instance, target namespace for xsd:schema.
  4. At the end, click the button Check and Fix in toolbar, which helps you make appropriate changes to the WSDL definition in further (if you haven't done), such as to add property xmlns in wsdl:definitions element which refers to the target namespace specified.
    Check and fix
    Check and fix

Summary of WSDL elements

wsdl:definition

The WSDL definition element is the root element which may contain elements like wsdl:import, wsdl:documentation, wsdl:types, wsdl:message, wsdl:portType, wsdl:binding and wsdl:service. In wsdl:definition, the target namespace (attribute) must be specified. Elements contained by wsdl:definition will be part of the target namespace specified. Here is an example of WSDL definitions, with target namespace and some other fundamental attributes defined.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  ...

  <wsdl:types>...</wsdl:types>
  <wsdl:message>...</wsdl:message>
  <wsdl:portType>...</wsdl:portType>

  ...
 
</wsdl:definitions>

wsdl:types

The WSDL types element is responsible for describing data types used by the operation(s) within the web service. To be clear, the type definition is to be used as input, output and/or fault types of operations. Most often data types are specified using XML schema. Here is an example of WSDL types element that defines an input type, an output type and a fault type.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
  ...
 
  <wsdl:types>
    <xsd:schema targetNamespace="http://mycompany.org/shipment/">
    <xsd:element name="requestReceived" type="typeRequestReceived"/>
    <xsd:complexType name="typeRequestReceived">
      <xsd:sequence>
        <xsd:element name="receiveDate" type="xsd:date"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="requestBody" type="xsd:string"/>
      <xsd:element name="invalidRequest" type="xsd:string"/>
    </xsd:schema>
  </wsdl:types>

  ...

</wsdl:definitions>

wsdl:message

The WSDL message defines the data for input or output of an operation. Each WSDL message can include one or more WSDL parts element. A part serves as a parameter of WSDL operation.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  ...
    
  <wsdl:message name="getOrderRequest">
    <wsdl:part element="requestReceived" name="num" type="xsd:string"/>
    <wsdl:part name="createDate" type="xsd:date"/>
  </wsdl:message>
 
  ...
    
</wsdl:definitions>

wsdl:portType (Interface)

The WSDL portType, also known as interface, defines operations in a web service. It encloses the operations that can be performed, and each operation contains the input and output which refer to the messages (wsdl:message) defined. You may also add a fault element in addition to input and output for defining the message to send to client when a fault happen.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  ...
    
  <wsdl:portType name="shipment">
    <wsdl:operation name="shipOrder">
      <wsdl:input message="getOrderRequest" name="getOrderRequest"/>
      <wsdl:output message="getOrderRequest" name="getOrderResponse"/>
    </wsdl:operation>
  </wsdl:portType>
 
  ...
    
</wsdl:definitions>

wsdl:binding

For ODE, in order to make your web service accessible by others, you must defining the WSDL binding to describe the how your web service is bound to a network protocol.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  ...
    
  <wsdl:binding name="mybinding" type="shipment">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="shipOrder">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="order">
        <soap:body namespace="http://mycompany.org/shipment/" use="literal"/>
      </wsdl:input>
      <wsdl:output name="order">
        <soap:body namespace="http://mycompany.org/shipment/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
    
  ...
    
</wsdl:definitions>

wsdl:service

For ODE, the WSDL service element defines the end points (i.e. address) of web service. It contains one or more port elements which references the binding element.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Shipment Team"
  targetNamespace="http://mycompany.org/shipment/"
  xmlns="http://mycompany.org/shipment/"
  xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  xmlns:ns1="http://mycompany.org/shipment/"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  ...
    
  <wsdl:service name="OrderShipment">
    <wsdl:port binding="mybinding" name="shipmentEndPoint">
      <soap:address location="http://localhost:8080/ode/processes/ProviderPortService"/>
    </wsdl:port>
  </wsdl:service>

  ... 
 
</wsdl:definitions>

 

 
1. Introduction to WS-BPEL support Table of Contents 3. Pool (process)
 

Product

Try this feature with

Visual Paradigm for UML

Technical Support

Have technical issues or suggestions? Please contact Visual Paradigm Support Team.

Sales Support

Have questions related to registration, licensing or payment? Feel free to contact Visual Paradigm Sales Team.

Discussion Forum

Share your suggestions of opinions at VP Discussion Forum.