Saturday, 2 April 2016

What are the elements in WSDL ?


Sample WSDL document structure

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" targetNamespace="your namespace  here" xmlns:tns="your  namespace  here"xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap">
  <wsdl:types>
    <xs:schema  targetNamespace="your  namespace here" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      <!--  Define  types  and  possibly  elements  here  -->
    </schema>
  </wsdl:types>
  <wsdl:message  name="some  operation  input">
    <!--  part(s)  here  -->
  </wsdl:message>
  <wsdl:message  name="some  operation  output">
    <!--  part(s)  here  -->
  </wsdl:message>
  <wsdl:portType  name="your  type  name">
    <!--  Operations  here  in  terms  of  their  messages  -->
  </wsdl:portType>
  <wsdl:binding  name="your  binding  name"  type="tns:port  type  name  above">
    <!--  Style  & transport  in  general  and use  per  operation  -->
  </wsdl:binding>
  <wsdl:service>
    <!--  Port  here using  the  above  binding  and  a  URL  -->
  </wsdl:service>
</wsdl:definitions>



WSDL Elements

 1. Types
 2. Message
 3. Operation
 4. Port Type
 5. Binding
 6. Port
 7. Service


Types
  • Data type definitions
  • Used to describe exchanged messages

Messages
  • Abstract, typed definitions of data being exchanged
  • It describes the message logically instead of physically

Operations
  • Abstract description of an action
  • Refers to an input and/or output messages
  • Several types of operations can be declared in a WSDL document. They are
    • Request / Response
      A client makes a request, and the Web service responds to it.
    • Solicit / Response
      A Web service sends a message to the client, and the client responds.
    • One-way
      A client sends a message to the Web service but expects no response.
    • Notification
      A Web service sends a message to the client but expects no response.

Port type
  • Collection of operations, that provides a one-stop point where a client can obtain information on all operations.
  • Abstract definition of a service

Binding
  • Concrete protocol and data format (encoding) for a particular Port type
  • Protocol examples: SOAP 1.1 over HTTP or SOAP 1.1 over SMTP
  • Encoding examples: SOAP encoding, RDF encoding

Port
  • Defines a single communication endpoint
  • Endpoint address for binding
  • URL for HTTP, email address for SMTP

Service
  • Aggregate set of related ports

No comments:

Post a Comment

Note: only a member of this blog may post a comment.