WSDL
Web Services Description Language (commonly abbreviated WSDL) is an XML-based language used to define web services and to describe how to access them. WSDL is a suggestion by Ariba, IBM and Microsoft for describing services for the W3C XML Activity on XML Protocols. You can read more about WSDL in our WSDL tutorial.
Contents
Specifications
- Web Services Description Language (WSDL) 1.1: http://www.w3.org/TR/wsdl
- WSDL 2.0: http://www.w3.org/TR/wsdl20/
- WSDL 2.0 primer: https://www.w3.org/TR/wsdl20-primer/
- WSDL 2.0 adjuncts: http://www.w3.org/TR/wsdl20-adjuncts/
What is WSDL?
* WSDL stands for Web Services Description Language * WSDL is written in XML * WSDL is an XML document * WSDL is used to describe Web services * WSDL is also used to locate Web services * WSDL is not yet a W3C standard
Independence from Operating Systems
Operating System and Device Independence is acheived through consistent namespaces and document definitions provided by the W3C.
Format
A WSDL document describes a Web Service and the available methods it exposes. A WSDL binding describes how the service is bound to a messaging protocol, particularly the SOAP messaging protocol. A WSDL SOAP binding can be either a Remote Procedure Call (RPC) style binding or a document style binding. A SOAP binding can also have an encoded use or a literal use. This gives you four style/use models:
- RPC/encoded
- RPC/literal
- Document/encoded
- Document/literal
WSDL Elements
Element | Description |
types | Defines data types that a web service’s messages can use. |
message | Defines the data that a web services operation transfers. |
portType | Defines one or more operations that a web service provides. |
operation | Defines a combination of input, output, and fault messages. |
input | Specifies a message that a client such as a Flex application sends to a web service. |
output | Specifies a message that a web service sends to a client such as a Flex application. |
fault | Specifies an error value returned as a result of a problem processing a message. |
binding | Specifies the protocol used to communicate with a web service. Bindings exist for SOAP, HTTP GET, HTTP POST, and MIME. Flex supports the SOAP binding only. |
service | Defines a collection of ports. Each service maps to one portType and specifies different ways to access the operations in that portType. |
port | A web services endpoint that specifies an association between a binding and a network address. |
EXAMPLES
- BC$ MobileTV -- RockPaperScissors Game - test WSDL: http://bcmoney-mobiletv.com/api/soap/RockPaperScissors?wsdl
WSDL 1.1
<message name="getRecommendationRequest"> <part name="recommendation" type="xs:integer"/> <part name="title" type="xs:string"/> <part name="image" type="xs:string"/> <part name="link" type="xs:string"/> </message> <message name="getRecommendationResponse"> <part name="recommendationValue" type="xs:integer"/> <part name="titleValue" type="xs:string"/> <part name="imageValue" type="xs:string"/> <part name="linkValue" type="xs:string"/> </message> <portType name="recommendations"> <operation name="recommend"> <input message="getRecommendationRequest"/> <output message="getRecommendationResponse"/> </operation> </portType> <binding type="recommendations" name="b1"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://bcmoney-mobiletv.com/services/recommend"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding>
WSDL 2.0
<description> <message name="getRecommendationRequest"> <part name="recommendation" type="xs:integer"/> <part name="title" type="xs:string"/> <part name="image" type="xs:string"/> <part name="link" type="xs:string"/> </message> <message name="getRecommendationResponse"> <part name="recommendationValue" type="xs:integer"/> <part name="titleValue" type="xs:string"/> <part name="imageValue" type="xs:string"/> <part name="linkValue" type="xs:string"/> </message> <types name="recommendations"> <operation name="recommend"> <input message="getRecommendationRequest"/> <output message="getRecommendationResponse"/> </operation> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://bcmoney-mobiletv.com/services/recommend"> <xs:element name="recommend"> <xs:complexType> <xs:sequence/> </xs:complexType> </xs:element> </xs:schema> </types> <interface name="recommendations"> <operation name="recommend" pattern="http://www.w3.org/ns/wsdl/in-out"> <input element="#any"/> <output element="#any"/> </operation> </interface> </binding> <service name="RecommendationService" interface="video:Recommend"> <endpoint name="VideoRecommender" binding="video:RecommendSoapBinding" address="http://bcmoney-mobiletv.com/services/recommend/video"/> </service> </description>
Tools
- WSDL Validator: http://www.validwsdl.com/
- WSDL Analyzer: http://xmethods.net/ve2/Tools.po
- WSDL 1.1 to WSDL 2.0 Converter: http://www.w3.org/2006/02/WSDLConvert.html
- WSDL viewer: https://tomi.vanek.sk/[2]
Resources
- PHP WSDL Generator: http://www.phpclasses.org/package/3509-PHP-Generate-WSDL-from-PHP-classes-code.html
- PHP2WSDL: http://sourceforge.net/projects/php2wsdl/
- Apache CXF - java2wsdl: http://cxf.apache.org/docs/java-to-wsdl.html
- Apache CXF - WSDL to Javascript: http://cxf.apache.org/docs/wsdl-to-javascript.html
- XSLT wsdl-viewer: http://code.google.com/p/wsdl-viewer/[3] | EXAMPLE - RockPaperScissors.wsdl
- JavaScript SOAP Client: http://www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx
- A proxy generator to WebServices for JavaScript and AJAX: http://www.codeproject.com/KB/XML/JavaScriptProxy_01.aspx
- Implementing a Javascript client for SOAP based WebServices: http://www.mathertel.de/AJAX/JavaScriptSOAPClient.aspx
- WSDL Viewer (example usage): http://www.w3.org/2000/06/webdata/xslt?xslfile=http://tomi.vanek.sk/xml/wsdl-viewer.xsl&xmlfile=http://198.164.40.210:8080/SAVOIR_MgmtServices/services/UserManagerWS?wsdl&transform=Submit#op.d1e583
- Flickr example WSDL: * Flickr WSDL: http://svn.wso2.org/repos/wso2/tags/mashup/java/0.1/wsas/java/modules/samples/FlickrClient/wsdl/FlickrService.wsdl (unofficial)
- W3Schools -- Temperature converter SOAP Web Services (WSDL): https://www.w3schools.com/xml/tempconvert.asmx?WSDL
Tutorials
- Getting Started with JAX-WS Web Services (in NetBeans 6.x+ WSDL Design view): http://netbeans.org/kb/docs/websvc/jax-ws.html
- WSDL processing with XSLT: http://www.ibm.com/developerworks/library/ws-trans/index.html
- Processing WSDL documents with XSLT: http://www.ibm.com/developerworks/webservices/library/ws-xsltwsdl/
- wsimport - Java™ API for XML Web Services (JAX-WS) 2.0: http://docs.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html
- Working with WSDLs (in SoapUI): http://www.soapui.org/SOAP-and-WSDL/working-with-wsdls.html
- Axis2's WSDL 2.0 HTTP Code generation a.k.a Try Flickr API using Axis2: http://wso2.com/node/1132/print
- Invoking Applications RESTfully: http://docs.wso2.org/display/AS520/Invoking+Applications+RESTfully (as of SOAP 1.2 and WSDL 2.0 specs, REST/GET can also be used to get data back)
- JAX-WS annotations: https://jax-ws.java.net/jax-ws-ea3/docs/annotations.html
- What should I change to get a different element name on the response XSD of an automatically generated JAX-WS?: http://stackoverflow.com/a/16538435/335867
- Create and Deploy Simple Web Service and Web Service Client in Eclipse: https://crunchify.com/create-and-deploy-simple-web-service-and-web-service-client-in-eclipse/
- How to Create Sample WSDL in Eclipse and Generate Client: https://crunchify.com/create-sample-wsdl-in-eclipse-and-generate-client/
External Links
- wikipedia: Web Services Description Language
- WSDL overview (SLIDES): https://www.slideshare.net/AkshayBallarpure/wsdl-53292780 (by a member of W3C involved in early SOA movement)
- Introduction to WSDL (Web Service Definition Language) – Sample HelloWorld Tutorial: https://crunchify.com/web-service-definition-language-sample-helloworld-wsdl/
- Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RESTful Web Services: https://www.slideshare.net/ecosio/presentation-slideshare-34325282
- WSDL 2.0 for Flickr: http://auburnmarshes.spaces.live.com/blog/cns!F985A6952BC07C4!654.entry
- What's New in WSDL 2.0: http://www.xml.com/pub/a/ws/2004/05/19/wsdl2.html
- Which style of WSDL should I use?: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
- WebSphere - Importing WSDL files to create message definitions: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fad30550_.htm
- Caché as Web Service Producer: http://docs.intersystems.com/cache20121/csp/docbook/DocBook.UI.Page.cls?KEY=TSOA_CacheAndWebServices
- Viewing the WSDL Document: http://docs.intersystems.com/cache20121/csp/docbook/DocBook.UI.Page.cls?KEY=TSOA_ViewingTheWSDL
- Relationship between UDDI & WSDL: https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jst.ws.consumption.ui.doc.user%2Fconcepts%2Fcwsdlud.html
- Understanding WSDL: https://dzone.com/articles/understanding-wsdl
References
- ↑ IBM DeveloperWorks on Which WSDL format to use in different scenarios: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
- ↑ PHP app for validating/viewing WSDL: http://tomi.vanek.sk/index.php?page=wsdl-viewer
- ↑ http://tomi.vanek.sk/index.php?page=wsdl-viewer
- ↑ http://wso2.org/repos/wso2/people/jonathan/flickr.wsdl