?WSDL
to the URL of a running service
created with VS .NET and deployed on IIS.Data Types <wsdl:types/> |
Messages <wsdl:message/> |
Interfaces <wsdl:portType/> |
Services <wsdl:binding/> <wsdl:service/> |
<wsdl:definitions name="nmtoken"? targetNamespace="uri"> <import namespace="uri" location="uri"/>* <wsdl:documentation .... /> ? <wsdl:types> ? <wsdl:documentation .... />? <xsd:schema .... />* <!-- extensibility element --> * </wsdl:types> <wsdl:message name="nmtoken"> * <wsdl:documentation .... />? <part name="nmtoken" element="qname"? type="qname"?/> * </wsdl:message> <wsdl:portType name="nmtoken">* <wsdl:documentation .... />? <wsdl:operation name="nmtoken">* <wsdl:documentation .... /> ? <wsdl:input name="nmtoken"? message="qname">? <wsdl:documentation .... /> ? </wsdl:input> <wsdl:output name="nmtoken"? message="qname">? <wsdl:documentation .... /> ? </wsdl:output> <wsdl:fault name="nmtoken" message="qname"> * <wsdl:documentation .... /> ? </wssdl:fault> </wsdl:operation> </wsdl:portType> <wsdl:binding name="nmtoken" type="qname">* <wsdl:documentation .... />? <!-- extensibility element --> * <wsdl:operation name="nmtoken">* <wsdl:documentation .... /> ? <!-- extensibility element --> * <wsdl:input> ? <wsdl:documentation .... /> ? <!-- extensibility element --> </wsdl:input> <wsdl:output> ? <wsdl:documentation .... /> ? <!-- extensibility element --> * </wsdl:output> <wsdl:fault name="nmtoken"> * <wsdl:documentation .... /> ? <!-- extensibility element --> * </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:service name="nmtoken"> * <wsdl:documentation .... />? <wsdl:port name="nmtoken" binding="qname"> * <wsdl:documentation .... /> ? <!-- extensibility element --> </wsdl:port> <!-- extensibility element --> </wsdl:service> <!-- extensibility element --> * </wsdl:definitions>
types
element holds data definitions
relevant to the messages.part
s <definitions .... > <types> <schema .... > <element name="PO" type="tns:POType"/> <complexType name="POType"> <all> <element name="id" type="string/> <element name="name" type="string"/> <element name="items"> <complexType> <all> <element name="item" type="tns:Item" minOccurs="0" maxOccurs="unbounded"/> </all> </complexType> </element> </all> </complexType> <complexType name="Item"> <all> <element name="quantity" type="int"/> <element name="product" type="string"/> </all> </complexType> <element name="Invoice" type="tns:InvoiceType"/> <complexType name="InvoiceType"> <all> <element name="id" type="string"/> </all> </complexType> </schema> </types> <message name="PO"> <part name="po" element="tns:PO"/> <part name="invoice" element="tns:Invoice"/> </message> </definitions>
portType
is a named set of abstract
operations and the abstract messages involved.name
attribute provides a unique name among
all port types defined within in the enclosing WSDL
document.name
attribute.<wsdl:definitions .... > <wsdl:portType .... > * <wsdl:operation name="nmtoken"> <wsdl:input name="nmtoken"? message="qname"/> </wsdl:operation> </wsdl:portType > </wsdl:definitions>
input
element specifies the abstract message format for
the one-way operation.<wsdl:definitions .... > <wsdl:portType .... > * <wsdl:operation name="nmtoken" parameterOrder="nmtokens"> <wsdl:input name="nmtoken"? message="qname"/> <wsdl:output name="nmtoken"? message="qname"/> <wsdl:fault name="nmtoken" message="qname"/>* </wsdl:operation> </wsdl:portType > </wsdl:definitions>
input
and output
elements
specify the abstract message format for the request and
response, respectively.fault
elements specify the
abstract message format for any error messages that may be
output as the result of the operation.<wsdl:definitions .... > <wsdl:portType .... > * <wsdl:operation name="nmtoken" parameterOrder="nmtokens"> <wsdl:output name="nmtoken"? message="qname"/> <wsdl:input name="nmtoken"? message="qname"/> <wsdl:fault name="nmtoken" message="qname"/>* </wsdl:operation> </wsdl:portType > </wsdl:definitions>
input
and output
elements
specify the abstract message format for the request and
response, respectively.fault
elements specify the
abstract message format for any error messages that may be
output as the result of the operation.<wsdl:definitions .... > <wsdl:portType .... > * <wsdl:operation name="nmtoken"> <wsdl:output name="nmtoken"? message="qname"/> </wsdl:operation> </wsdl:portType > </wsdl:definitions>
output
element specifies the abstract
message format for the notification operation.portType
.name
attribute provides a unique name among
all bindings defined within in the enclosing WSDL document.portType
that it binds
using the type
attribute.<binding name="StockQuoteSoap" type="tns:StockQuotePortType"> <soap:binding style="document" transport="http://example.com/smtp"/> <operation name="SubscribeToQuotes"> <input message="tns:SubscribeToQuotes"> <soap:body parts="body" use="literal"/> <soap:header message="tns:SubscribeToQuotes" part="subscribeheader" use="literal"/> </input> </operation> </binding>
name
attribute provides a unique name among
all bindings defined within in the enclosing WSDL document.binding
attribute (of type QName) refers to
the binding using the linking rules defined by WSDL.<wsdl:service name="HelloService"> <wsdl:port name="HelloPort" binding="tns:HelloWorldBinding"><!--defined by a previous binding--> <soap:address location="http://localhost:8080"/> </wsdl:port> </wsdl:service>
<?xml version="1.0"?> <definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns:xsda="http://example.com/stockquote/schema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema targetNamespace="http://example.com/stockquote/schema" xmlns="http://www.w3.org/2000/10/XMLSchema"> <complexType name="TimePeriod"> <all> <element name="startTime" type="xsd:timeInstant"/> <element name="endTime" type="xsd:timeInstant"/> </all> </complexType> <complexType name="ArrayOfFloat"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:float[]"/> </restriction> </complexContent> </complexType> </schema> </types> <message name="GetTradePricesInput"> <part name="tickerSymbol" element="xsd:string"/> <part name="timePeriod" element="xsda:TimePeriod"/> </message> <message name="GetTradePricesOutput"> <part name="result" type="xsda:ArrayOfFloat"/> <part name="frequency" type="xsd:float"/> </message> <portType name="StockQuotePortType"> <operation name="GetLastTradePrice" parameterOrder="tickerSymbol timePeriod frequency"> <input message="tns:GetTradePricesInput"/> <output message="tns:GetTradePricesOutput"/> </operation> </portType> <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetTradePrices"> <soap:operation soapAction="http://example.com/GetTradePrices"/> <input> <soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/> </port> </service> </definitions>
GetTradePrices
SOAP 1.1 request may be sent to a StockQuote
service via the SOAP 1.1 HTTP binding.TimePeriod
structure containing a start and end
time and returns an array of stock prices recorded by the
service within that period of time, as well as the frequency
at which they were recorded as the SOAP response.tickerSymbol
and
timePeriod
followed by the output parameter
frequency, and returns an array of floats.<?xml version="1.0"?> <!-- WSDL description of the Google Web APIs. The Google Web APIs are in beta release. All interfaces are subject to change as we refine and extend our APIs. Please see the terms of use for more information. --> <definitions name="urn:GoogleSearch" targetNamespace="urn:GoogleSearch" xmlns:typens="urn:GoogleSearch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Types for search - result elements, directory categories --> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:GoogleSearch"> <xsd:complexType name="GoogleSearchResult"> <xsd:all> <xsd:element name="documentFiltering" type="xsd:boolean"/> <xsd:element name="searchComments" type="xsd:string"/> <xsd:element name="estimatedTotalResultsCount" type="xsd:int"/> <xsd:element name="estimateIsExact" type="xsd:boolean"/> <xsd:element name="resultElements" type="typens:ResultElementArray"/> <xsd:element name="searchQuery" type="xsd:string"/> <xsd:element name="startIndex" type="xsd:int"/> <xsd:element name="endIndex" type="xsd:int"/> <xsd:element name="searchTips" type="xsd:string"/> <xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/> <xsd:element name="searchTime" type="xsd:double"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElement"> <xsd:all> <xsd:element name="summary" type="xsd:string"/> <xsd:element name="URL" type="xsd:string"/> <xsd:element name="snippet" type="xsd:string"/> <xsd:element name="title" type="xsd:string"/> <xsd:element name="cachedSize" type="xsd:string"/> <xsd:element name="relatedInformationPresent" type="xsd:boolean"/> <xsd:element name="hostName" type="xsd:string"/> <xsd:element name="directoryCategory" type="typens:DirectoryCategory"/> <xsd:element name="directoryTitle" type="xsd:string"/> </xsd:all> </xsd:complexType> <xsd:complexType name="ResultElementArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategoryArray"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="DirectoryCategory"> <xsd:all> <xsd:element name="fullViewableName" type="xsd:string"/> <xsd:element name="specialEncoding" type="xsd:string"/> </xsd:all> </xsd:complexType> </xsd:schema> </types> <!-- Messages for Google Web APIs - cached page, search, spelling. --> <message name="doGetCachedPage"> <part name="key" type="xsd:string"/> <part name="url" type="xsd:string"/> </message> <message name="doGetCachedPageResponse"> <part name="return" type="xsd:base64Binary"/> </message> <message name="doSpellingSuggestion"> <part name="key" type="xsd:string"/> <part name="phrase" type="xsd:string"/> </message> <message name="doSpellingSuggestionResponse"> <part name="return" type="xsd:string"/> </message> <message name="doGoogleSearch"> <part name="key" type="xsd:string"/> <part name="q" type="xsd:string"/> <part name="start" type="xsd:int"/> <part name="maxResults" type="xsd:int"/> <part name="filter" type="xsd:boolean"/> <part name="restrict" type="xsd:string"/> <part name="safeSearch" type="xsd:boolean"/> <part name="lr" type="xsd:string"/> <part name="ie" type="xsd:string"/> <part name="oe" type="xsd:string"/> </message> <message name="doGoogleSearchResponse"> <part name="return" type="typens:GoogleSearchResult"/> </message> <!-- Port for Google Web APIs, "GoogleSearch" --> <portType name="GoogleSearchPort"> <operation name="doGetCachedPage"> <input message="typens:doGetCachedPage"/> <output message="typens:doGetCachedPageResponse"/> </operation> <operation name="doSpellingSuggestion"> <input message="typens:doSpellingSuggestion"/> <output message="typens:doSpellingSuggestionResponse"/> </operation> <operation name="doGoogleSearch"> <input message="typens:doGoogleSearch"/> <output message="typens:doGoogleSearchResponse"/> </operation> </portType> <!-- Binding for Google Web APIs - RPC, SOAP over HTTP --> <binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="doGetCachedPage"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doSpellingSuggestion"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="doGoogleSearch"> <soap:operation soapAction="urn:GoogleSearchAction"/> <input> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <!-- Endpoint for Google Web APIs --> <service name="GoogleSearchService"> <port name="GoogleSearchPort" binding="typens:GoogleSearchBinding"> <soap:address location="http://api.google.com/search/beta2"/> </port> </service> </definitions>
This talk available at http://jmvidal.cse.sc.edu/talks/wsdl/
Copyright © 2009 José M. Vidal
.
All rights reserved.
21 April 2004, 09:34AM