Mindmajix

What is WSDL in Web Services

WSDL Enters….

A WSDL document is just a simple XML document.

It contains set of definitions to describe a web service.

WSDL document fulfills all the above requirements

  • Requirement 1 – Where is the service hosted

              <service>

  • Requirement 2 – What protocol to use to talk to the service

             <binding>

  • Requirement 3 – What are the operations

             <portType>

  • Requirement 4 – What are the parameters

             <message>

  • Requirement 5 – What is the datatype of the messages

             <type>

Introducing WSDL

  • WSDL stands for Web Services Description Language
  • WSDL is written in XML
  • WSDL is used to describe Web services
  • WSDL is also used to locate Web services
  • WSDL is a W3C recommendation

WSDL Document Structure

Screenshot_91

 WSDL Ports

  • The <portType> element is the most important WSDL element.
  • It describes a web service, the operations that can be performed, and the messages that are involved.
  • The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language

Screenshot_92

 Operation Types

Type Definition
One-way The operation can receive a message but will not return a response
Request-response The operation can receive a request and will return a response
Solicit-response The operation can send a request and will wait for a response
Notification The operation can send a message but will not wait for a response

One-way operation type

The operation can receive a message but will not return a response

Screenshot_93

Request-response operation type

The operation can receive a request and will return a response

Screenshot_94

Now, a web service operation can take only one parameter.  But I want to pass multiple parameters……what do I need to do

WSDL Messages

  • The <message> element defines the data elements of an operation.
  • Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.

 Screenshot_95

I want to pass a complex object to my web service……what do I need to do

WSDL Types

  • The <types> element defines the data type that are used by the web service.
  • For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.

Screenshot_96

I want my web service to be accessible to a HTTP client, as well as to a RMI client and a SOAP client……what do I need to do

WSDL Bindings

The <binding> element defines the message format and protocol details for each port.

Screenshot_97

Screenshot_98

Binding

  • name – can be anything
  • Type – points to port

Soap:binding

  • Style – rpc or document
  • Transport – soap protocol to use

Operation

  • Defines each operation the the service exposes

WSDL Bindings

  • The <binding> element provides specific details on how a portType operation will actually be transmitted over the wire.
  • The bindings can be made available via multiple transports, including HTTP GET, HTTP POST, or SOAP.
  • The bindings provide concrete information on what protocol is being used to transfer portType operations.
  • For SOAP protocol, the binding is <soap:binding>, and the transport is SOAP messages on top of HTTP protocol.
  • WSDL 1.1 includes built-in extensions for SOAP 1.1. This enables you to specify SOAPspecific details, including SOAP headers, SOAP encoding styles, and the SOAPAction HTTP header. The SOAP extension elements include:
  • soap:binding
  • soap:operation
  • soap:body
  • You can specify multiple bindings for a single portType.

WSDL Services

The <services> element connects the binding to an actual URL where the service is available.

Screenshot_99

A service element describes a Web service as a collection of port elements. A port element defines a specific network address for a binding. The sample below shows the basic outline of a service that supplies an address for a SOAP binding:

<service name=”ServiceName“>

   <port name=”PortName” binding=”BindingRef“>

      <soap:address location=”URL”/>

   </port>

</service>

The ServiceName sets the name of the service. The PortName sets the name of the specific address. The BindingRef refers to the name of a binding element. The BindingRef must be namespace qualified if the targetNamespace for the WSDL definitions element is not the same as the default namespace.

Example

Screenshot_100

https://en.wikipedia.org/wiki/Web_Services_Description_Language

 

 Enroll for Instructor Led Live Tibco BW Training

0 Responses on What is WSDL in Web Services"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.