WSDL: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
394 bytes added ,  2 December 2007
adding
m (minor)
(adding)
Line 8: Line 8:
WSDL can be quite formidable to understand for those not used to looking at such things. Probably the easiest way to get to grips with is is to break it down into its various components.
WSDL can be quite formidable to understand for those not used to looking at such things. Probably the easiest way to get to grips with is is to break it down into its various components.


After any initial processing instruction (<?xml version="1.0" encoding="UTF-8"?> or similar) there will be the outer '''<description>''' element, which will typically also define a number of '''''[[namespaces]]''''' that will be used in the document.
After any initial processing instruction (<?xml version="1.0" encoding="UTF-8"?> or similar) there will be the outer '''<description>''' element, which will typically also define a number of '''''[[namespace]]s''''' that will be used in the document.


Within that there will (usually, and in WSDL 1.1) be four or five main types of element, grouped together, in the following order:
Within that there will (usually, and in WSDL 1.1) be four or five main types of element, grouped together, in the following order:
Line 32: Line 32:


===The "''service''" element===
===The "''service''" element===
Although the last of the children of the <description> element, the '''service''' element is the natural starting point for human WSDL readers.  There ''can'' be more than one service defined in a single WSDL document, which is sometimes sensible for describing different physical services which share the same logical definition (a service provider might provide the same service from a number of different network locations - i.e. servers - to provide redundancy, or multiple services might share some aspects, in particular data types, in common), however most commonly only a single service will be described.


Although the last of the children of the <description> element, this is the natural starting point for human WSDL readersThere ''can'' be more than one service defined in a single WSDL document, which is sometimes sensible for describing different physical services which share the same logical definition (a service provider might provide the same service from a number of different network locations - i.e. servers - to provide redundancy, or multiple services might share some aspects, in particular data types, in common), however most commonly only a single service will be described.
Like most of the WSDL main elements, the service element can have a <documentation> element within it.  In [[Visual DataFlex]] you can set this via the "psDocumentation" property of the Web Service objectIt will also have a '''name''' attribute, which will be whatever you set the psServiceName property of your Web Service object to.


Like most of the WSDL main elements, the service element can have a <documentation> element within it.  In [[Visual DataFlex]] you can set this via the "psDocumentation" property of the Web Service object.
The crucial element within the service is the '''<port>'''. This defines an implementation of the service as a network resource and has a "binding" attribute which will usually point to a <binding> element (see below) in the same WSDL document (and hence will tend to have the namespace prefix "tns": this nampespace).
 
The crucial element within the service is the '''<port>'''. This defines an implementation of the service as a network resource and has, as an attribute, a "binding", which will usually point to a <binding> element (see below) in the same WSDL document (and hence will tend to have the namespace prefix "tns").


While there are sometimes other protocols defined (HTTP, SMTP, FTP, etc.), the commonest by far is for SOAP, so within the <port> element it is common to find a '''<soap:address>''' element, specifying, via its "location" attribute, the actual [[URI]] through which the service can be invoked.
While there are sometimes other protocols defined (HTTP, SMTP, FTP, etc.), the commonest by far is for SOAP, so within the <port> element it is common to find a '''<soap:address>''' element, specifying, via its "location" attribute, the actual [[URI]] through which the service can be invoked.


===The "''binding''" element===
The '''binding''' element is what joins the physical implementation of the secvice - a <port> element within the <service> element - to its logical (or abstarct) definition, which is represented by the <portType> element (see below).




===The "''binding''" element===


===the "''portType''" element===
===the "''portType''" element===

Navigation menu