What is WSDL , Use of WSDL in java Web Services
WSDL (Web Services Description Language) is an XML file that describes a web service and all its operations,input and output messages as a collection of access endpoints. WSDL defines a web service in an abstract way with separate definitions and terminology.By using WSDL, Our application can able to connect and use a web service.
The main elements in the WSDL file as follows :
|The * mark represents , that element my appear one or more than one.|
<definitions> : It is the root element for the WSDL document.It acts as a container for the service with global namespaces declarations.
Namespace :XML namespaces are a mechanism that ensures that there are no name conflicts (or ambiguity) when combining XML documents or referencing an XML element.
xmlns : Reserved word to declare a namespace
soap : Is the prefix with the namespace “http://schemas.xmlsoap.org/wsdl/soap/”
http://schemas.xmlsoap.org/wsdl/soap/ : XML location
<import> :This element imports the namespace of another file, similar to the java import statement.It includes all elements for the given namespace are included at the location of the <import> element in the used document.
<types> : This element acts as a container for defining the data types.It provides information about any complex data types used in the WSDL document. When simple types are used the document does not need to have a types section. It has a sub element <schema>.
<message>: It is An abstract definition of the data being communicated , it reference the types defined in the <types> section (schemaLocation).The <message> element is uniquely identified by it’s name attribute.It has a sub element <part>.
<portType> : It is An abstract set of operations supported by one or more endpoints. It has a sub element <operation> is an abstract definition of an action (like java method definition) supported by a web service.
<operation> has two sub elements <input> and <output>.
<input> defines the input message. <output> defines the output message. Both <input> and <output> elements reference <message> elements defined in the same WSDL document or an imported one.
<binding> : Describes how the operation is invoked by specifying concrete protocol and data format specifications for the operations and messages.The name attribute defines a unique identifier for this binding.
The value of the type attribute must be the name of one of the <portType> elements contained within the same WSDL document or in an imported one.
<service> : This element is useful to identify the service.By using the service name , we can get the port to use all operations that are available in the web services.
<service> has two sub elements <documentation> and <port>.
<documentation> is an optional element that describes the web service.
Another element <port>,it has one sub element <soap:address> which identifies the URL (location) of the web service.
|Related Posts :|
|How to Connect to Oracle from Liferay portlet ( Java Liferay and Oracle integration )|
|How to Connect Liferay 7 to PostgreSQL ( Java Liferay portlet and PostgreSQL integration )|
|How to call C# .Net WCF web service in PHP SOAP client|
|How to call C# .Net WCF web service in java SOAP client ( Visual Studio 2013 )|
|How to call PHP RESTful web service in java client|
|How to call java SOAP web service in php ( php web service client )|
|Solution to SSLHandshakeException (skip the certificate for Java and LDAP bind)|
|Java RESTful web service example in maven using JAX-RS|