Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

WSDL Tutorials - Herong's Tutorial Examples
WSDL Tutorials - Herong's Tutorial Examples
WSDL Tutorials - Herong's Tutorial Examples
Ebook515 pages

WSDL Tutorials - Herong's Tutorial Examples

Rating: 0 out of 5 stars

()

Read preview

About this ebook

This book is a collection of notes and sample codes written by the author while he was learning WSDL himself. Topics include introduction to WSDL (Web Services Definition Language); WSDL document structure; 'types', 'interface', 'binding' and 'service' definition elements; differences between style='rpc' and style='document'; using WSDL document with SoapUI; parsing WSDL documents with Python, PHP, Perl, and Java programs. Updated in 2024 (Version v2.22) with Python tutorials.

For latest updates and free sample chapters, visit https://www.herongyang.com/WSDL.
LanguageEnglish
PublisherLulu.com
Release dateApr 20, 2019
ISBN9780359605071
WSDL Tutorials - Herong's Tutorial Examples

Read more from Herong Yang

Related to WSDL Tutorials - Herong's Tutorial Examples

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for WSDL Tutorials - Herong's Tutorial Examples

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    WSDL Tutorials - Herong's Tutorial Examples - Herong Yang

    The Front Cover

    WSDL Tutorials

    - Herong's Tutorial Examples

    Icon
    v2.22, 2024
    Herong Yang
    Copyright © 2007-2024 Herong Yang. All rights reserved.
    ISBN: 978-0-359-60507-1

    This book is a collection of notes and sample codes written by the author while he was learning WSDL himself. Topics include introduction to WSDL (Web Services Definition Language); WSDL document structure; 'types', 'interface', 'binding' and 'service' definition elements; differences between style='rpc' and style='document'; using WSDL document with SoapUI; parsing WSDL documents with Python, PHP, Perl, and Java programs. Updated in 2024 (Version v2.22) with Python tutorials.

    Table of Contents

    About This Book

    Introduction to WSDL 2.0

    What Is WSDL 2.0

    A Sample WSDL 2.0 Document

    WSDL 2.0 Core, Adjuncts and Extensions

    List of APIs and Tools for WSDL 1.1 and 2.0

    WSDL 2.0 Document Structure and Syntax

    Overview of WSDL 2.0 Document Structure

    description - The Root Element

    types - The Container Element for Data Types

    interface - Interface Definition Element

    binding - Binding Definition Element

    service - Service Definition Element

    WSDL Version 2.0 Part 2: Adjuncts

    WSDL Message Exchange Patterns

    wsdlx:safe=true|false Operation Safety

    Operation Message Styles

    SOAP Binding Extension

    SOAP 1.2 Binding Rules

    WSDL 2.0 Document Examples with SOAP Binding

    No Style Example - Hello

    RPC Style Example - Get Stock Price

    IRI Style Example - Get Exchange Rate

    Multiplart Style Example - Reservation

    Using WSDL Document in Java Apache Axis2/Java for WSDL

    What Is Axis2

    Downloading and Installing Axis2/Java

    org.apache.axis2.client.ServiceClient Class

    Creating Service Client with WSDL Document

    WSDL2Java Converting WSDL 2.0 Documents to Stub Classes

    Apache Woden for WSDL Documents in Java

    What Is Apache Woden - WSDL Parser API

    Java API for WSDL 2.0 Component Model

    WodenHelloComponent.java - Testing WSDL 2.0 Components

    Java API for WSDL 2.0 Element Model

    WodenHelloElement.java - Testing WSDL 2.0 Elements

    Wsdl20Validator.java - WSDL 2.0 Validator

    WSDL 2.0-2 Adjuncts Not Supported by Woden API

    Convert WSDL 1.1 to 2.0 with Woden API

    SoapUI - Web Service Testing Tool

    What Is SoapUI

    Downloading and Installing SoapUI

    Validating and Inspecting WSDL Documents

    PHP SOAP Extension for WSDL

    What Is PHP SOAP Extension

    Downloading and Installing PHP

    Configuring and Testing SOAP Extension

    Perl SOAP::Lite for WSDL

    What Is Perl SOAP::Lite

    Installing ActivePerl on Windows

    Installing SOAP::Lite Package

    Testing Perl SOAP::Lite with WSDL Documents

    Introduction to WSDL 1.1

    What Is WSDL 1.1

    A Sample WSDL 1.1 Document

    WSDL 1.1 Framework and Extensions

    WSDL 1.1 Document Structure and Syntax

    Overview of WSDL 1.1 Document Structure

    definitions - The Root Element

    types - The Container Element for Data Types

    message - Message Type Definition Element

    portType - Port Type Definition Element

    binding - Binding Definition Element

    service - Service Definition Element

    WSDL 1.1 Binding Extension for SOAP 1.1

    What Is WSDL 1.1 SOAP Extension

    soap:binding - Binding Message Style and Transportation

    soap:operation - SOAPAction Header Line

    soap:body - Binding for SOAP Body

    soap:fault - Binding for SOAP Fault Details

    soap:header - Binding for SOAP Header

    soap:address - Location of Service

    SoapUI as WSDL 1.1 Testing Tool

    Validating and Inspecting WSDL 1.1 Documents

    Using Interface Viewer on Bindings

    Generating HTML Documentations On Bindings

    Generating SOAP Requests on Operations

    Submit SOAP Requests to the Server

    MockService - Web Service Simulator

    Submitting Request to MockService

    Loading Incorrect WSDL Documents

    WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

    SOAP 1.1 Message Styles and Encoding Options

    First Example - Hello

    Request and Response - Hello

    document/literal Example - Guest Registration

    Request and Response - Guest Registration

    rpc/encoded Example - Get Exchange Rate

    Request and Response - Get Exchange Rate

    SOAP Body and Operation Name - Book Reservation

    Request and Response - Book Reservation

    elementFormDefault=qualified - Refill Order

    Request and Response - Refill Order

    encodingStyle=uri for use=encoded

    Request and Response - Get Stock Price

    PHP SOAP Extension for WSDL 1.1

    Testing SOAP Extension with WSDL 1.1

    Methods on the SoapClient Class

    Calling an RPC Method Based Web Service

    encodingStyle=uri Required for rpc/encoded

    SoapParam Constructor - Creating Named Parameters

    SoapVar Constructor - Creating Encoded Values

    XSD_ANYXML Encoding - Building SOAP Body Element

    Calling an XML Document Based Web Service

    Perl SOAP::Lite for WSDL 1.1

    Introduction of Perl SOAP::Lite for WSDL

    Methods on SOAP::Lite Client Object

    Calling PRC Methods Defined in WSDL 1.1 Documents

    service() Method Returns New Objects

    SOAP::Data - XML Elements as Data Objects

    SOAP::Serializer - Converting Data Objects to XML

    Creating a Data Object for a Single XML Element

    Creating a Data Object for Nested XML Elements

    SOAP::Deserializer - Converting XML to Data Objects

    Calling XML Document Based Web Service

    Using Operation Name as the SOAP Body Element Name

    Apache Axis2/Java for WSDL 1.1

    Creating Service Client with WSDL 1.1 Document

    org.apache.axis2.client.Options - Operation Client Options

    sendReceive() Method - Invoking a Named Operation

    Turning Off the Chunked HTTP Flag

    AXIOM (AXIs Object Model)

    Axis2RegistrationClient.java - document/literal Style

    org.apache.axis2.rpc.client.RPCServiceClient Class

    Axis2GetExchangeRateClient.java - rpc/encoded Style

    SocketRequestResponseServer.java - Socket Server Testing Program

    Capturing the HTTP Request from an Axis2 Client Program

    Using WSDL2Java to Generate Web Service Stub Classes

    What Is WSDL2Java

    Generating Client Side Stub Java Code

    Stub and Data Type Classes

    Using Stub and Data Type Classes

    XML Document Based Web Service Example

    Unexpected subelement ... Error from the Stub Class

    RPC Method Based Web Service Example

    WSDL 1.1 Binding Extension for SOAP 1.2

    What Is WSDL 1.1 SOAP Extension

    soap12:binding - Binding Message Style and Transportation

    soap12:operation - SOAPAction Header Line

    soap12:body - Binding for SOAP Body

    soap12:fault - Binding for SOAP Fault Details

    soap12:header - Binding for SOAP Header

    soap12:address - Location of Service

    WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

    SOAP 1.2 Message Styles and Encoding Options

    document/literal Example - Guest Registration

    Request and Response - Guest Registration

    rpc/encoded Example - Get Exchange Rate

    Request and Response - Get Exchange Rate

    SOAP Body and Operation Name - Book Reservation

    Request and Response - Book Reservation

    elementFormDefault=qualified - Refill Order

    Request and Response - Refill Order

    SOAP 1.2 Binding - PHP, Java and Perl Clients

    PHP SOAP Extension - RPC Method Based Web Services

    PHP SOAP Extension - XML Document Based Web Services

    Java Axis2 - RPC Method Based Web Services

    Java Axis2 - XML Document Based Web Services

    Perl SOAP::Lite - No WSDL 1.1/SOAP 1.2 Support

    Perl - SOAP 1.2 Request on SOAP 1.1 WSDL

    Python SOAP Client: Zeep

    What Is Zeep Python Library

    Installing Python Engine on macOS

    Installing Zeep Library

    Parsing WSDL Documents with Zeep Library

    Invoking WSDL Services with Zeep Library

    Invoking WSDL Default Service

    WSDL 2.0 Not Supported by Zeep Library

    WSDL Related Terminologies

    Archived Tutorials

    Archived: Downloading and Installing SoapUI 3.0.1

    Archived: SoapUI 3.0.1 MockService - Web Service Simulator

    Archived: Downloading and Installing PHP 5.3.1

    Archived: Downloading and Installing Axis2/Java 1.4.1

    Archived: Axis2GetSpeechClient.java - document/literal Style

    References

    Keywords: WSDL, Web Service, SOAP, Tutorial

    WSDL Tutorials - Herong's Tutorial Examples

    ∟ About This Book

    This section provides some detailed information about this book - WSDL Tutorials - Herong's Tutorial Examples.

    Title: WSDL Tutorials - Herong's Tutorial Examples

    Author: Herong Yang - Contact by email via herong_yang@yahoo.com.

    Category: Programming

    Version/Edition: v2.22, 2024

    Number of pages in PDF format: 307

    Description: This book is a collection of notes and sample codes written by the author while he was learning WSDL himself. Topics include introduction to WSDL (Web Services Definition Language); WSDL document structure; 'types', 'interface', 'binding' and 'service' definition elements; differences between style='rpc' and style='document'; using WSDL document with SoapUI; parsing WSDL documents with Python, PHP, Perl, and Java programs. Updated in 2024 (Version v2.22) with Python tutorials.

    Keywords: WSDL, Web Service, SOAP, service, end point, interface, operation, type

    Copyright:

    This book is under Copyright Copyright © 2007-2024 Herong Yang. All rights reserved.

    Material in this book may not be published, broadcasted, rewritten or redistributed in any form.

    Code examples are provided as-is, with no warranty of any kind.

    Revision history:

    Version v2.22, 2024. Added Python tutorials

    Version v2.00, 2009. Added tutorials for WSDL 2.0

    Version v1.00, 2007. Started with WSDL 1.1

    Web version: https://www.herongyang.com/WSDL - Provides free sample chapters, latest updates and readers' comments. The Web version of this book has been viewed a total of:

    1,468,908 times as of December 2023.

    1,397,881 times as of December 2022.

    1,330,538 times as of December 2021.

    1,247,650 times as of December 2020.

    1,168,790 times as of December 2019.

    1,094,250 times as of December 2018.

    1,034,113 times as of December 2017.

    960,756 times as of December 2016.

    863,444 times as of December 2015.

    720,258 times as of December 2014.

    541,086 times as of December 2013.

    392,226 times as of December 2012.

    230,123 times as of December 2011.

    82,837 times as of December 2010.

    PDF/EPUB version: https://www.herongyang.com/WSDL/PDF-Full-Version.html - Provides information on how to obtain the full version of this book in PDF, EPUB, or other format.

    WSDL Tutorials - Herong's Tutorial Examples

    ∟ Introduction to WSDL 2.0

    This chapter provides a quick introduction of WSDL 2.0. Topics include introduction components used in WSDL 2.0 to define a Web service; a sample WSDL 2.0 document defines a helloService Web service with one method, Hello.

    What Is WSDL 2.0

    A Sample WSDL 2.0 Document

    WSDL 2.0 Core, Adjuncts and Extensions

    List of APIs and Tools for WSDL 1.1 and 2.0

    Takeaways:

    WSDL 2.0 is a language that can be used to define Web services as WSDL documents.

    WSDL 2.0 uses several layers of components to define a Web service.

    WSDL 2.0 specification is divided into Core, Adjuncts and Extensions language sets.

    WSDL 2.0 is still not well supported, even it's been introduced since year 2007.

    WSDL Tutorials - Herong's Tutorial Examples

    Introduction to WSDL 2.0

    ∟ What Is WSDL 2.0

    This section describes what is a WSDL 2.0 - Version 2.0 of WSDL (Web Services Definition Language is a language that can be used to define Web services as WSDL documents.

    What is WSDL (Web Services Definition Language)? WSDL is a language that can be used to define Web services.

    WSDL was developed by W3C. 2 major versions have been released so far.

    WSDL 1.1 - Released on 15 March 2001. Specification of WSDL 1.1 is available at https://www.w3.org/TR/2001/NOTE-wsdl-20010315.

    WSDL 2.0 - Released on 26 June 2007. Specification of WSDL 2.0 is available at http://www.w3.org/TR/wsdl20-primer/.

    At a high level, WSDL is a language that allows you to write WSDL documents, so that:

    A WSDL document can define a set of Web services.

    A Web service can be defined as an interface and a set of end points.

    An end point can be defined as an address and a binding.

    An address can be defined to tell where the service is provided.

    A binding can be defined to tell how messages should be formatted and transmitted.

    An interface can be defined as a set of operations.

    An operation can be defined as a sequence of input and output messages.

    Here is a diagram that illustrates how WSDL can be used to define Web services in a WSDL document:

    WSDL 2.0 Document Structure

    WSDL 2.0 Document Structure

    WSDL Tutorials - Herong's Tutorial Examples

    Introduction to WSDL 2.0

    ∟ A Sample WSDL 2.0 Document

    This section describes a sample WSDL 2.0 document, which defines a Web service, helloService, with an operation called Hello.

    Here is a simple example of WSDL 2.0 document represented in XML format, Hello_WSDL_20_SOAP.wsdl:

    1.0?>

    http://www.w3.org/ns/wsdl

      xmlns:wsoap= http://www.w3.org/ns/wsdl/soap

      xmlns:hy=https://www.herongyang.com/Service/

      targetNamespace=https://www.herongyang.com/Service/>

     

     

        Hello_WSDL_20_SOAP.wsdl

        Copyright (c) 2009 HerongYang.com. All Rights Reserved.

     

     

     

        http://www.w3.org/2001/XMLSchema

          targetNamespace=https://www.herongyang.com/Service/>

          Hello type=xsd:string/>

          HelloResponse type=xsd:string/>

       

     

     

      helloInterface>

        Hello

          pattern=http://www.w3.org/ns/wsdl/in-out>

          In element=hy:Hello/>

          Out element=hy:HelloResponse/>

       

     

     

      helloBinding

        interface=hy:helloInterface

        type=http://www.w3.org/ns/wsdl/soap

        wsoap:protocol=http://www.w3.org/2003/05/soap/bindings/HTTP/>

        hy:Hello

          wsoap:mep=http://www.w3.org/2003/05/soap/mep/soap-response/>

     

     

      helloService

        interface=hy:helloInterface>

        helloEndpoint

          binding=hy:helloBinding

          address=https://www.herongyang.com/Service/Hello_SOAP_12.php/>

     

     

    In this WSDL 2.0 sample document,

    A Web service, helloService, is defined with an endpoint, helloEndpoint, with an access address at https://www.herongyang.com/Service/Hello_SOAP_12.php.

    The endpoint, helloEndpoint, is linked to a binding, helloBinding.

    The binding, helloBinding, is defined with a communication protocol, SOAP 1.2 over HTTP.

    The binding, helloBinding, is linked to an interface, helloInterface.

    The interface, helloInterface, is defined with an operation, Hello, which requires an input message element and an output message element.

    Each element, Hello/HelloResponse, is defined by an XML schema included in the Types section.

    This sample WSDL document is also available at https://www.herongyang.com/Service/Hello_WSDL_20_SOAP.wsdl.

    Note that the follow style attribute has been removed the operation, Hello, because the input message XML element definition does not meet the requirements of the specified style, iri. Based on WSDL 2.0 specification, message style is optional. You don't have to follow any predefined styles. Thanks to Ridita who informed me this error.

      style=http://www.w3.org/ns/wsdl/style/iri

    WSDL Tutorials - Herong's Tutorial Examples

    Introduction to WSDL 2.0

    ∟ WSDL 2.0 Core, Adjuncts and Extensions

    This section describes WSDL 2.0 core, adjuncts, and extensions: message exchange patterns, operation safety and styles extensions, SOAP and HTTP extensions.

    The original WSDL 2.0 language specification (published in 2007 at http://www.w3.org/TR/wsdl20/) was divided into 2 parts: Core and Adjuncts:

    Core, represented by URI: http://www.w3.org/ns/wsdl - Defines the core language which can be used to describe Web services based on an abstract model of what the service offers.

    SOAP Adjuncts, - Defines extension language for these areas:

    Message exchange patterns - Define the sequence and cardinality of abstract messages listed in an operation. Predefined patterns are: In-Only, Robust In-Only, and In-Out.

    Operation safety extension - Adds the safe property to Interface Operation components defined in the Core.

    Operation styles extension - Defines operation styles that can be used to place constraints on Interface Operation components defined in the Core. Predefined styles are: RPC, IRI, and Multipart.

    SOAP binding extension - Defines binding language to bind a Web service from an abstract model to a concrete model using SOAP 1.2.

    HTTP binding extension - Defines binding language to bind a Web service from an abstract model to a concrete model using HTTP.

    Later, another extension was added: WSDL 2.0 SOAP 1.1 Binding (published at http://www.w3.org/TR/wsdl20-soap11-binding).

    WSDL SOAP 1.1 Binding - Defines binding language to bind a Web service from an abstract model to a concrete model using SOAP 1.1.

    WSDL Tutorials - Herong's Tutorial Examples

    Introduction to WSDL 2.0

    ∟ List of APIs and Tools for WSDL 1.1 and 2.0

    This section provides a list of programming APIs and testing tools that support WSDL documents. Most of them support only WSDL 1.1, not WSDL 2.0.

    WSDL 1.1 has been widely supported by many programming APIs and testing tools. But WSDL 2.0 is still not well supported, even it's been introduced since year 2007.

    Here is a list of programming APIs and testing tools that I have tested with WSDL 1.1 and WSDL 2.0:

    API/Tool            Version  Year  WSDL 1.1  WSDL 2.0

     

    Apache Axis2/Java    1.7.8    2018  Yes        Yes

    Apache Woden        1.0M10    2015  No        Yes

    Perl SOAP::Lite      1.27      2007  Yes        No

    PHP SOAP Extension  7.0.2    2015  Yes        No

    SoapUI              5.2.0    2018  Yes        No

    XMLSpy              2019      2019  Yes        Yes

    WSDL Tutorials - Herong's Tutorial Examples

    ∟ WSDL 2.0 Document Structure and Syntax

    This chapter provides tutorial notes and example codes on WSDL 2.0 document structure and syntax. Topics include WSDL document overview, Syntax of description, types, interface, binding, and service elements.

    Overview of WSDL 2.0 Document Structure

    description - The Root Element

    types - The Container Element for Data Types

    interface - Interface Definition Element

    binding - Binding Definition Element

    service - Service Definition Element

    Takeaways:

    description is the root element of a WSDL 2.0 document.

    types, interface, binding and service are top elements of a WSDL 2.0 document.

    WSDL extensions must be used together with WSDL core language to complete a WSDL 2.0 document.

    WSDL Tutorials - Herong's Tutorial Examples

    WSDL 2.0 Document Structure and Syntax

    ∟ Overview

    Enjoying the preview?
    Page 1 of 1