WSDL: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
1,032 bytes added ,  2 December 2007
adding...
(adding)
(adding...)
Line 25: Line 25:
* The base WSDL namespace: ="<span style="color:midnightblue;">xmlns="<nowiki>http://schemas.xmlsoap.org/wsdl/</nowiki>"</span>
* The base WSDL namespace: ="<span style="color:midnightblue;">xmlns="<nowiki>http://schemas.xmlsoap.org/wsdl/</nowiki>"</span>
* The XML Schema namespace, where the base XML types are defined: ="<span style="color:midnightblue;">xmlns:xs="<nowiki>http://www.w3.org/2001/XMLSchema</nowiki>"</span>
* The XML Schema namespace, where the base XML types are defined: ="<span style="color:midnightblue;">xmlns:xs="<nowiki>http://www.w3.org/2001/XMLSchema</nowiki>"</span>
* The SOAP namespace: ="<span style="color:midnightblue;">xmlns:soap<nowiki>"http://schemas.xmlsoap.org/wsdl/soap/</nowiki>"</span>
* The [[SOAP]] namespace: ="<span style="color:midnightblue;">xmlns:soap<nowiki>"http://schemas.xmlsoap.org/wsdl/soap/</nowiki>"</span>
* The service's own namespace, which is usually associated with the namespace prefix "tns" - ('''t'''his '''n'''ame'''s'''pace): ="<span style="color:midnightblue;">xmlns:tns="http://''yourDomain/yourService/serviceName''"</span>
* The service's own namespace, which is usually associated with the namespace prefix "tns" - ('''t'''his '''n'''ame'''s'''pace): ="<span style="color:midnightblue;">xmlns:tns="http://''yourDomain/yourService/serviceName''"</span>
* The "target" namespace, which is often identical to the "tns" one: ="<span style="color:midnightblue;">targetNamespace="http://''yourDomain/yourService/serviceName''"</span>
* The "target" namespace, which is often identical to the "tns" one: ="<span style="color:midnightblue;">targetNamespace="http://''yourDomain/yourService/serviceName''"</span>


There may be many more than these (look ant any Microsoft .Net service WSDL), but most services will define at least these ones as a minimum, although not always in exactly that form.
There may be ''many'' more than these (look at any Microsoft .Net service WSDL), but most services will define at least these ones as a minimum, although not always in exactly that form. In particular, the choice of namespace prefixes is arbitrary, so the base namespace might be specified as "xmlns:wsdl", rather than just "xmlns"; "xmlns:xs" is often seen as "xmlns:xsd"; "xmlns:soap" might be "xmlns:soap12" (in reference to SOAP 1.2) or many other variations - remember that it is the actual namespace URI that is being referenced that is important, not the prefix used to represent it ikn the document, which can be anything.


===The "''service''" element===
===The "''service''" element===
Line 36: Line 36:
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.  It 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.  It will also have a '''name''' attribute, which will be whatever you set the psServiceName property of your Web Service object to.


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 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).  This will attribute will lead us on our trail, ''up'' the WSDL, to our next stop, the binding element.


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.
Line 43: Line 43:
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 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 will have two attributes which effect this joining: its '''name''' attribute, which is what is pointed to by the "binding" attribute of the service "port" element above and its '''type''' attribute which in turn points to a "portType" (again, usually defined within the same WSDL document and hence having a "tns" prefix.


Within the binding element there will be one or more protocol binding elements, the most common of which is the '''<soap:binding>''',


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

Navigation menu