SlideShare a Scribd company logo
1 of 53
Download to read offline
Move on to WSDL 2.0 and Apache
            Woden



         Sagara Gunathunga
          Apache Committer
Who am I ?

• Apache Woden Committer
• Also contribute to Apache Axis2 and
  Apache Camel .
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
What is a contract in real world ?
Contract in Web services

WHAT ?
                   HOW ?




         WHERE ?
WHAT it does ?
• Define the purpose and function of its operations.

• Define the messages that need to be exchanged in
  order to engage the operations.

• Define data models used to define the structure of the
  messages.

• Define a set of conditions under which the operations
  are provided.

• Define information about how and where the service
  can be accessed.
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
Today’s SDLs

• WSDL 1.1 ( Web Service Description Language 1.1)

• WADL ( Web Application Description Language)

• SSDL (SOAP Service Description Language)
WSDL 1.1
  WSDL is an XML-based language used to define
  Web Services and describe how to access them.

WSDL is an XML format for describing network services as
a set of endpoints operating on messages containing either
document-oriented or procedure-oriented style.

WSDL 1.0 was Jointly developed by IBM, Microsoft and
many others in 2000.

WSDL 1.1 released in 2001.

Compliant with WSDL Basic profile 1.0
WSDL 1.1
Pros
 • Proven and Widely used in industry for last few years.

 • Compliant with WS-I basic profile 1.0
 • Many projects available - WSDL4J , WOM
 • Code generation tools available –
    Axis2 /CXF WSDL2Java ,wsimport


Cons
  • Really complex language.
   • Hard learning curve.
   • Not fit with REST services.
WADL
WADL is a description language for HTTP-based Web
applications, such as applications which follow the
REST architectural style.



  Written by Marc Hadley at Sun somewhere around
  2006.
  From August 2009 WADL is a W3C Member
  Submission.
Pros
 • Works well with REST services.

 • Automation tools available -
         WADL2JAVA , Google REST compiler
 • Some projects available   - Jersey


Cons
 • Still not widely used as WSDL 1.1

 • Doesn't support for SOAP based web services.
SSDL
The SOAP Service Description Language (SSDL) is a
SOAP-centric contract description language for Web
Services
Pros
• Works well with SOAP based web services.
• Project available - Soya for C#


Cons
• Not widely used in neither industry nor academic purposes.
• Only support for SOAP.
• No automation tools available .
• No project for java.
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   Introduction to Apache Woden
•   WSDL 2.0 and REST
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
WSDL 2.0
• Improved version of WSDL 1.1

• Simple and no ambiguities unlike WSDL 1.1 and easy
  learning curve.

• Fully supports for both SOAP based and RESTful web
  services.

• Removal of message constructs. These are specified
  using the XML schema type system.

•   Possibility to define QoS – features and properties
WSDL 2.0
• Well defined Message Exchange Patterns (MEP)

• Some WS engines already supports and provide
  automation tools
     - Axis2 and WSDL2Java
Wsdl1.1/2.0 Comparison
   WSDL 1.1          WSDL 2.0
<definition>    <description>
<portType>      <interface>
<binding>       <binding>
<types>         <types>
<service>       <service>
<port>          <endpoint>
<message>       Within <operation>
WSDL 2.0 component model




Description is container for 2 types of top-level components.
   (1) WSDL Component (interface , binding , services)
   (2) Type system component
          (ElementDeclaration,typeDefinition)
WSDL 2.0 nested component
          model
Feature & property
Provides additional processing information for a component
example – reliability , correlation
MEP – Message Exchange
                 patterns
MEP defines a contract between service and client
WSDL 2.0 defines 8 MEPs




•   In-Only
•   Robust In-Only
•   In-Out
•   In-Optional-Out
•   Out-Only
•   Robust Out-Only
•   Out-In
•   Out-Optional-In
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
WSDL 2.0 and REST
The "WSDL 2.0 Part 2: Adjuncts" provides the specifics of
HTTP, SOAP 1.2, and MEP usage with WSDL 2.0. WSDL
2.0 HTTP Binding can be used to define REST services
successfully.

Following HTTP methods can be used.
7. GET
8. POST
9. PUT
10.DELETE
WSDL 2.0/ HTTP Binding
Binding type should be http://www.w3.org/2006/01/wsdl/http
<binding
       name="xs:NCName"
       interface="xs:QName"?
       type="http://www.w3.org/ns/wsdl/http"
       whttp:methodDefault="xs:string"?
       whttp:queryParameterSeparator
                           Default="xs:string"?
       whttp:cookies="xs:boolean"?
       whttp:contentEncodingDefault="xs:string"? >
WSDL 2.0/ HTTP Binding
<operation ref="xs:QName"
         whttp:location="xs:anyURI"?
         whttp:method="xs:string"?
         whttp:inputSerialization="xs:string"?
         whttp:outputSerialization="xs:string"?
         whttp:faultSerialization="xs:string"?
         whttp:queryParameterSeparator="xs:string"?
         whttp:contentEncodingDefault="xs:string"?
         whttp:ignoreUncited="xs:boolean"? >

In most cases “location” and “method” attributes are
sufficient .
Example

<wsdl2:binding name="DemoServiceHttpBinding"
         interface="tns:DemoServiceInterface"
         type=http://www.w3.org/ns/wsdl/http >

    <wsdl2:operation
           ref="tns:demo"
           whttp:method="POST"
           whttp:location="demo“ />
</wsdl2:binding>
Input and Output Serialization
                Formats
Input format   -      {http input serialization}
Output format -       {http output serialization}

HTTP Method        Default Input           Default Output
                   Serialization           Serialization
GET                application/x-www-      application/xml
                         form-urlencoded
POST               application/xml         application/xml

PUT                application/xml         application/xml

DELETE             application/x-www-      application/xml
                         form-urlencoded
Example
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
Apache Woden


 Apache Web Services Project to develop a
 Java class library for reading, manipulating,
 creating and writing WSDL documents, initially
 to support WSDL 2.0 but with the longer term
 aim of supporting past, present and future
 versions of WSDL.
Who uses Woden
    - Apache Axis2
    - Apache ServiceMix
Main deliverables
1.   Woden API for WSDL 2.0
2.   DOM based implementation.
3.   OM (Axiom) based implementation.
4.   WSDL 2.0 validator tool
5.   WSDL1.1 to 2.0 Converter tool.
6.   Maven plug-ins and Ant Tasks for above tools
Two APIs
Component model API
  •Mirror the component model of WSDL 2.0

    •One root Description object representing a merge of all
    .wsdl files imported and included


Element level API
    Mirror the XML representation of WSDL 2.0

     Represent the physical Xml file representation
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
Component level – Element
              level
To Component model              To Element model
aElement.toComponent()        aComponent.toElement()


 Example
     DescriptionElement descElement;
     Description descComponent;

      descComponent=descElement.toComponent();
      descElement=descComponent.toElement();
Define the implementation
                 DOM or OM
Using WSDLFactory you can specify the implementation.
Default implementation is based on DOM
For DOM implementation
WSDLFactory FWSDLFactory=WSDLFactory.newInstance();
                          OR
WSDLFactory FWSDLFactory=
    WSDLFactory.newInstance(“org.apache.woden.internal.DOMWSDLFactory”);



For OM implementation
WSDLFactory FWSDLFactory=

     WSDLFactory.newInstance(“org.apache.woden.internal.OMWSDLFactory”);
Reading WSDL 2.0 documents

     // create WSDL factory instance.
 WSDLFactory FWSDLFactory=WSDLFactory.newInstance();

    //create WSDL reader instance
 WSDLReader reader=FWSDLFactory.newWSDLReader();

   //set validation
 reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);

  //read the WSDL file in to a DescriptionElement
 DescriptionElement descElem = reader.readWSDL(wsdlurl);
Writing WSDL 2.0 document
   // create WSDL factory instance.
WSDLFactory FWSDLFactory=WSDLFactory.newInstance();

  //create WSDL writer instance
WSDLWriter writer=FWSDLFactory.newWSDLWriter()

  //Write WSDL in to the console
writer.writeWSDL(descElem, System.out )

  //write WSDL as a file
writer.writeWSDL(descElem, new FileOutputStream("test.wsdl") )
create WSDL document
At the moment only support for Element level API

   WSDLFactory wsdlFactory=WSDLFactory.newInstance();


   DescriptionElement descElement=wsdlFactory.newDescription();
   descElement.setTargetNamespace(new URI("http://my.com") );


   InterfaceElement interElement=descElement.addInterfaceElement();
   InterfaceOperationElement
            iOpElement=interElement.addInterfaceOperationElement();


   BindingElement bindingElement=descElement.addBindingElement();
   BindingOperationElement
          bOpElement=bindingElement.addBindingOperationElement();
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
Woden tools - validation
• Schema validations done by the XML parsers.

• Semantic validations done by Woden validator.
  - on the WSDL object model assertions are checked
  against the model.

• All errors are reported in one pass. Woden does not
  stop-on-first-error like WSDL4J.
Woden tools - Validation

Validation is ‘off’ by default.
Enable validation before reading the WSDL



Example

   reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
Woden tools - WSDL Converter
• Perform WSDL 1.1 to 2.0 conversion.
• Another great feature.
• Based on XSLT style sheet.
• Available as a Standalone tool, as a Maven plug-in or an
  Ant Task
Woden tools - WSDL Converter
In command line

java -Djava.ext.dirs=/home/sagara/woden
             org.apache.woden.tool.converter.Convert
                       -wsdl /home/sagara/test/converter/Echo.wsdl


 programmatically

 Convert convert = new Convert();
  try {
        convertFile =
        convert.convertFile(newTargetNS,wsdlDoc,
                              targetDir,verbose,overwrite);
        System.out.println(convertFile);
   } catch (Exception e) {
        e.printStackTrace();
   }
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
What is new in Woden 0.9
• Woden Serialization - WSDLWriter based on DOM and
  OM.

• Split QName into a different package to resolve conflicts in
  OSGI environments.

• Remove dependency on Xereces , now Woden(dom) work
  with any JAXP implementation

• Component level equals method.

• Logging framework based on Commons-logging API.

• WSDL Converter Maven plug-in and Ant Task

• Code base refactored for more Maven friendly manner .
Outline
•   Introduction to SDLs
•   Today’s SDLs
•   Introduction to WSDL 2.0
•   WSDL 2.0 and REST
•   Introduction to Apache Woden
•   Hands-on Apache Woden
•   Apache Woden tools
•   What is new in Apache Woden 0.9
•   WSDL 2.0 based WS development in Axis2
WSDL 2.0 based WS development
            in Axis2
Axs2 supports for WSDL 2.0
 1.) Contract first Web services.
 2.) Code first services
WSDL 2.0 based WS development
            in Axis2
In Contract first WS development you can use Axis2
WSDL2JAVA tool to generate source codes from your
WSDL 2.0 documents.
Both WSDL2JAVA Ant Task and Maven Plug-in supports
for WSDL 2.0
In WSDL2JAVA Command line tool use -wv 2 or -wv 2.0
options. With Maven Plug-in use wsdlVersion option.
 Example :

      wsdl2java -wv 2    OR      wsdl2java -wv 2 .0
WSDL 2.0 based WS development
            in Axis2
In code first approach, to generate WSDL 2.0 document
use ?wsdl2 instead of ?wsdl .

 Example :



     http://localhost:8080/services/SimpleService?wsdl2
Contribution
• Site : http://ws.apache.org/woden/

• Mailing list : woden-dev@ws.apache.org
Thank You

More Related Content

What's hot

Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
sanjoysanyal
 
Web services
Web servicesWeb services
Web services
aspnet123
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 

What's hot (20)

Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
 
Wsdl
WsdlWsdl
Wsdl
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
 
Web service introduction
Web service introductionWeb service introduction
Web service introduction
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
 
Web service
Web serviceWeb service
Web service
 
Web services
Web servicesWeb services
Web services
 
Web services
Web servicesWeb services
Web services
 
SOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIESSOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIES
 
Web Service
Web ServiceWeb Service
Web Service
 
Java web services
Java web servicesJava web services
Java web services
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 

Similar to WSDL 2.0 and Apache Woden

Java Web services
Java Web servicesJava Web services
Java Web services
Sujit Kumar
 
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
sanjoysanyal
 
WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0
WSO2
 

Similar to WSDL 2.0 and Apache Woden (20)

Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
 
WebServices introduction in Mule
WebServices introduction in MuleWebServices introduction in Mule
WebServices introduction in Mule
 
Oracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node finalOracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node final
 
Ntg web services
Ntg   web servicesNtg   web services
Ntg web services
 
Wt unit 6 ppts web services
Wt unit 6 ppts web servicesWt unit 6 ppts web services
Wt unit 6 ppts web services
 
Introduction to WSO2 Integration Platform
Introduction to WSO2 Integration PlatformIntroduction to WSO2 Integration Platform
Introduction to WSO2 Integration Platform
 
Tutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-servicesTutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-services
 
Developing and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesDeveloping and Hosting SOAP Based Services
Developing and Hosting SOAP Based Services
 
OUGN 2016: Experiences with REST support on OSB/SOA Suite
OUGN 2016: Experiences with REST support on OSB/SOA SuiteOUGN 2016: Experiences with REST support on OSB/SOA Suite
OUGN 2016: Experiences with REST support on OSB/SOA Suite
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
WebServices
WebServicesWebServices
WebServices
 
WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0
 
Wso2 tutorial
Wso2 tutorialWso2 tutorial
Wso2 tutorial
 
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
Directories for the REST of Us: REST to LDAP in OpenDJ 2.6
 
SOAP Service in Mule Esb
SOAP Service in Mule EsbSOAP Service in Mule Esb
SOAP Service in Mule Esb
 
OpenStack and OpenDaylight Workshop: ONUG Spring 2014
OpenStack and OpenDaylight Workshop: ONUG Spring 2014OpenStack and OpenDaylight Workshop: ONUG Spring 2014
OpenStack and OpenDaylight Workshop: ONUG Spring 2014
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
 
Webservices
WebservicesWebservices
Webservices
 

More from Sagara Gunathunga

Apache contribution-bar camp-colombo
Apache contribution-bar camp-colomboApache contribution-bar camp-colombo
Apache contribution-bar camp-colombo
Sagara Gunathunga
 

More from Sagara Gunathunga (20)

Microservices Security landscape
Microservices Security landscapeMicroservices Security landscape
Microservices Security landscape
 
Privacy by Design as a system design strategy - EIC 2019
Privacy by Design as a system design strategy - EIC 2019 Privacy by Design as a system design strategy - EIC 2019
Privacy by Design as a system design strategy - EIC 2019
 
Consumer Identity World EU - Five pillars of consumer IAM
Consumer Identity World EU - Five pillars of consumer IAM Consumer Identity World EU - Five pillars of consumer IAM
Consumer Identity World EU - Five pillars of consumer IAM
 
kicking your enterprise security up a notch with adaptive authentication sa...
kicking your enterprise security up a notch with adaptive authentication   sa...kicking your enterprise security up a notch with adaptive authentication   sa...
kicking your enterprise security up a notch with adaptive authentication sa...
 
Synergies across APIs and IAM
Synergies across APIs and IAMSynergies across APIs and IAM
Synergies across APIs and IAM
 
GDPR impact on Consumer Identity and Access Management (CIAM)
GDPR impact on Consumer Identity and Access Management (CIAM)GDPR impact on Consumer Identity and Access Management (CIAM)
GDPR impact on Consumer Identity and Access Management (CIAM)
 
Introduction to the All New WSO2 Governance Centre
Introduction to the All New WSO2 Governance CentreIntroduction to the All New WSO2 Governance Centre
Introduction to the All New WSO2 Governance Centre
 
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
 
An Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for JavaAn Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for Java
 
Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016 Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016
 
Introduction to the all new wso2 governance centre asia 16
Introduction to the all new wso2 governance centre asia 16Introduction to the all new wso2 governance centre asia 16
Introduction to the all new wso2 governance centre asia 16
 
Building Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case Study
Building Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case StudyBuilding Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case Study
Building Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case Study
 
Introduction to the All New WSO2 Governance Centre
Introduction to the All New WSO2 Governance CentreIntroduction to the All New WSO2 Governance Centre
Introduction to the All New WSO2 Governance Centre
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
 
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup
 
Application Monitoring with WSO2 App Server
Application Monitoring with WSO2 App ServerApplication Monitoring with WSO2 App Server
Application Monitoring with WSO2 App Server
 
WSO2 Application Server
WSO2 Application ServerWSO2 Application Server
WSO2 Application Server
 
Creating APIs with the WSO2 Platform
Creating APIs with the WSO2 PlatformCreating APIs with the WSO2 Platform
Creating APIs with the WSO2 Platform
 
WSO2 AppDev platform
WSO2 AppDev platformWSO2 AppDev platform
WSO2 AppDev platform
 
Apache contribution-bar camp-colombo
Apache contribution-bar camp-colomboApache contribution-bar camp-colombo
Apache contribution-bar camp-colombo
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

WSDL 2.0 and Apache Woden

  • 1. Move on to WSDL 2.0 and Apache Woden Sagara Gunathunga Apache Committer
  • 2. Who am I ? • Apache Woden Committer • Also contribute to Apache Axis2 and Apache Camel .
  • 3. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 4. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 5. What is a contract in real world ?
  • 6. Contract in Web services WHAT ? HOW ? WHERE ?
  • 7. WHAT it does ? • Define the purpose and function of its operations. • Define the messages that need to be exchanged in order to engage the operations. • Define data models used to define the structure of the messages. • Define a set of conditions under which the operations are provided. • Define information about how and where the service can be accessed.
  • 8. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 9. Today’s SDLs • WSDL 1.1 ( Web Service Description Language 1.1) • WADL ( Web Application Description Language) • SSDL (SOAP Service Description Language)
  • 10. WSDL 1.1 WSDL is an XML-based language used to define Web Services and describe how to access them. WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented style. WSDL 1.0 was Jointly developed by IBM, Microsoft and many others in 2000. WSDL 1.1 released in 2001. Compliant with WSDL Basic profile 1.0
  • 11. WSDL 1.1 Pros • Proven and Widely used in industry for last few years. • Compliant with WS-I basic profile 1.0 • Many projects available - WSDL4J , WOM • Code generation tools available – Axis2 /CXF WSDL2Java ,wsimport Cons • Really complex language. • Hard learning curve. • Not fit with REST services.
  • 12. WADL WADL is a description language for HTTP-based Web applications, such as applications which follow the REST architectural style. Written by Marc Hadley at Sun somewhere around 2006. From August 2009 WADL is a W3C Member Submission.
  • 13. Pros • Works well with REST services. • Automation tools available - WADL2JAVA , Google REST compiler • Some projects available - Jersey Cons • Still not widely used as WSDL 1.1 • Doesn't support for SOAP based web services.
  • 14. SSDL The SOAP Service Description Language (SSDL) is a SOAP-centric contract description language for Web Services
  • 15. Pros • Works well with SOAP based web services. • Project available - Soya for C# Cons • Not widely used in neither industry nor academic purposes. • Only support for SOAP. • No automation tools available . • No project for java.
  • 16. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • Introduction to Apache Woden • WSDL 2.0 and REST • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 17. WSDL 2.0 • Improved version of WSDL 1.1 • Simple and no ambiguities unlike WSDL 1.1 and easy learning curve. • Fully supports for both SOAP based and RESTful web services. • Removal of message constructs. These are specified using the XML schema type system. • Possibility to define QoS – features and properties
  • 18. WSDL 2.0 • Well defined Message Exchange Patterns (MEP) • Some WS engines already supports and provide automation tools - Axis2 and WSDL2Java
  • 19. Wsdl1.1/2.0 Comparison WSDL 1.1 WSDL 2.0 <definition> <description> <portType> <interface> <binding> <binding> <types> <types> <service> <service> <port> <endpoint> <message> Within <operation>
  • 20. WSDL 2.0 component model Description is container for 2 types of top-level components. (1) WSDL Component (interface , binding , services) (2) Type system component (ElementDeclaration,typeDefinition)
  • 21. WSDL 2.0 nested component model
  • 22. Feature & property Provides additional processing information for a component example – reliability , correlation
  • 23. MEP – Message Exchange patterns MEP defines a contract between service and client WSDL 2.0 defines 8 MEPs • In-Only • Robust In-Only • In-Out • In-Optional-Out • Out-Only • Robust Out-Only • Out-In • Out-Optional-In
  • 24. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 25. WSDL 2.0 and REST The "WSDL 2.0 Part 2: Adjuncts" provides the specifics of HTTP, SOAP 1.2, and MEP usage with WSDL 2.0. WSDL 2.0 HTTP Binding can be used to define REST services successfully. Following HTTP methods can be used. 7. GET 8. POST 9. PUT 10.DELETE
  • 26. WSDL 2.0/ HTTP Binding Binding type should be http://www.w3.org/2006/01/wsdl/http <binding name="xs:NCName" interface="xs:QName"? type="http://www.w3.org/ns/wsdl/http" whttp:methodDefault="xs:string"? whttp:queryParameterSeparator Default="xs:string"? whttp:cookies="xs:boolean"? whttp:contentEncodingDefault="xs:string"? >
  • 27. WSDL 2.0/ HTTP Binding <operation ref="xs:QName" whttp:location="xs:anyURI"? whttp:method="xs:string"? whttp:inputSerialization="xs:string"? whttp:outputSerialization="xs:string"? whttp:faultSerialization="xs:string"? whttp:queryParameterSeparator="xs:string"? whttp:contentEncodingDefault="xs:string"? whttp:ignoreUncited="xs:boolean"? > In most cases “location” and “method” attributes are sufficient .
  • 28. Example <wsdl2:binding name="DemoServiceHttpBinding" interface="tns:DemoServiceInterface" type=http://www.w3.org/ns/wsdl/http > <wsdl2:operation ref="tns:demo" whttp:method="POST" whttp:location="demo“ /> </wsdl2:binding>
  • 29. Input and Output Serialization Formats Input format - {http input serialization} Output format - {http output serialization} HTTP Method Default Input Default Output Serialization Serialization GET application/x-www- application/xml form-urlencoded POST application/xml application/xml PUT application/xml application/xml DELETE application/x-www- application/xml form-urlencoded
  • 31. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 32. Apache Woden Apache Web Services Project to develop a Java class library for reading, manipulating, creating and writing WSDL documents, initially to support WSDL 2.0 but with the longer term aim of supporting past, present and future versions of WSDL. Who uses Woden - Apache Axis2 - Apache ServiceMix
  • 33. Main deliverables 1. Woden API for WSDL 2.0 2. DOM based implementation. 3. OM (Axiom) based implementation. 4. WSDL 2.0 validator tool 5. WSDL1.1 to 2.0 Converter tool. 6. Maven plug-ins and Ant Tasks for above tools
  • 34. Two APIs Component model API •Mirror the component model of WSDL 2.0 •One root Description object representing a merge of all .wsdl files imported and included Element level API Mirror the XML representation of WSDL 2.0 Represent the physical Xml file representation
  • 35. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 36. Component level – Element level To Component model To Element model aElement.toComponent() aComponent.toElement() Example DescriptionElement descElement; Description descComponent; descComponent=descElement.toComponent(); descElement=descComponent.toElement();
  • 37. Define the implementation DOM or OM Using WSDLFactory you can specify the implementation. Default implementation is based on DOM For DOM implementation WSDLFactory FWSDLFactory=WSDLFactory.newInstance(); OR WSDLFactory FWSDLFactory= WSDLFactory.newInstance(“org.apache.woden.internal.DOMWSDLFactory”); For OM implementation WSDLFactory FWSDLFactory= WSDLFactory.newInstance(“org.apache.woden.internal.OMWSDLFactory”);
  • 38. Reading WSDL 2.0 documents // create WSDL factory instance. WSDLFactory FWSDLFactory=WSDLFactory.newInstance(); //create WSDL reader instance WSDLReader reader=FWSDLFactory.newWSDLReader(); //set validation reader.setFeature(WSDLReader.FEATURE_VALIDATION, true); //read the WSDL file in to a DescriptionElement DescriptionElement descElem = reader.readWSDL(wsdlurl);
  • 39. Writing WSDL 2.0 document // create WSDL factory instance. WSDLFactory FWSDLFactory=WSDLFactory.newInstance(); //create WSDL writer instance WSDLWriter writer=FWSDLFactory.newWSDLWriter() //Write WSDL in to the console writer.writeWSDL(descElem, System.out ) //write WSDL as a file writer.writeWSDL(descElem, new FileOutputStream("test.wsdl") )
  • 40. create WSDL document At the moment only support for Element level API WSDLFactory wsdlFactory=WSDLFactory.newInstance(); DescriptionElement descElement=wsdlFactory.newDescription(); descElement.setTargetNamespace(new URI("http://my.com") ); InterfaceElement interElement=descElement.addInterfaceElement(); InterfaceOperationElement iOpElement=interElement.addInterfaceOperationElement(); BindingElement bindingElement=descElement.addBindingElement(); BindingOperationElement bOpElement=bindingElement.addBindingOperationElement();
  • 41. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 42. Woden tools - validation • Schema validations done by the XML parsers. • Semantic validations done by Woden validator. - on the WSDL object model assertions are checked against the model. • All errors are reported in one pass. Woden does not stop-on-first-error like WSDL4J.
  • 43. Woden tools - Validation Validation is ‘off’ by default. Enable validation before reading the WSDL Example reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
  • 44. Woden tools - WSDL Converter • Perform WSDL 1.1 to 2.0 conversion. • Another great feature. • Based on XSLT style sheet. • Available as a Standalone tool, as a Maven plug-in or an Ant Task
  • 45. Woden tools - WSDL Converter In command line java -Djava.ext.dirs=/home/sagara/woden org.apache.woden.tool.converter.Convert -wsdl /home/sagara/test/converter/Echo.wsdl programmatically Convert convert = new Convert(); try { convertFile = convert.convertFile(newTargetNS,wsdlDoc, targetDir,verbose,overwrite); System.out.println(convertFile); } catch (Exception e) { e.printStackTrace(); }
  • 46. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 47. What is new in Woden 0.9 • Woden Serialization - WSDLWriter based on DOM and OM. • Split QName into a different package to resolve conflicts in OSGI environments. • Remove dependency on Xereces , now Woden(dom) work with any JAXP implementation • Component level equals method. • Logging framework based on Commons-logging API. • WSDL Converter Maven plug-in and Ant Task • Code base refactored for more Maven friendly manner .
  • 48. Outline • Introduction to SDLs • Today’s SDLs • Introduction to WSDL 2.0 • WSDL 2.0 and REST • Introduction to Apache Woden • Hands-on Apache Woden • Apache Woden tools • What is new in Apache Woden 0.9 • WSDL 2.0 based WS development in Axis2
  • 49. WSDL 2.0 based WS development in Axis2 Axs2 supports for WSDL 2.0 1.) Contract first Web services. 2.) Code first services
  • 50. WSDL 2.0 based WS development in Axis2 In Contract first WS development you can use Axis2 WSDL2JAVA tool to generate source codes from your WSDL 2.0 documents. Both WSDL2JAVA Ant Task and Maven Plug-in supports for WSDL 2.0 In WSDL2JAVA Command line tool use -wv 2 or -wv 2.0 options. With Maven Plug-in use wsdlVersion option. Example : wsdl2java -wv 2 OR wsdl2java -wv 2 .0
  • 51. WSDL 2.0 based WS development in Axis2 In code first approach, to generate WSDL 2.0 document use ?wsdl2 instead of ?wsdl . Example : http://localhost:8080/services/SimpleService?wsdl2
  • 52. Contribution • Site : http://ws.apache.org/woden/ • Mailing list : woden-dev@ws.apache.org