Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


Nota sobre WSDL: Endereços SOAP e Bindings HTTP e MIME, Notas de estudo de Análise de Sistemas de Engenharia

Uma nota disponibilizada pela w3c para discussão somente. Não representa um endossamento por parte da w3c ou de qualquer membro dela. A w3c não teve controle editorial na preparação desta nota. Contém informações sobre o uso de endereços soap, bindings http e mime no wsdl (web services description language). Descreve os elementos utilizados na definição de serviços de rede, incluindo mensagens, importações, extensibilidade e referências a esquemas xsd. Fornece exemplos de bindings http e mime, explicando como eles estendem o wsdl.

Tipologia: Notas de estudo

2011

Compartilhado em 01/11/2011

claudivan-moreira-8
claudivan-moreira-8 🇧🇷

3 documentos

1 / 26

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
Web Services Description Language (WSDL)
1.1
W3C Note 15 March 2001
This version:
http://www.w3.org/TR/2001/NOTE-wsdl-20010315
Latest version:
http://www.w3.org/TR/wsdl
Authors (alphabetically):
Erik Christensen, Microsoft
Francisco Curbera, IBM Research
Greg Meredith, Microsoft
Sanjiva Weerawarana, IBM Research
Copyright© 2001 Ariba, International Business Machines Corporation, Microsoft
Abstract
WSDL is an XML format for describing network services as a set of endpoints
operating on messages containing either document-oriented or procedure-oriented
information. The operations and messages are described abstractly, and then
bound to a concrete network protocol and message format to define an endpoint.
Related concrete endpoints are combined into abstract endpoints (services).
WSDL is extensible to allow description of endpoints and their messages
regardless of what message formats or network protocols are used to
communicate, however, the only bindings described in this document describe
how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
Status
This document is a submission to the World Wide Web Consortium (see
Submission Request, W3C Staff Comment) as a suggestion for describing
services for the W3C XML Activity on XML Protocols. For a full list of all
acknowledged Submissions, please see Acknowledged Submissions to W3C.
Pa
g
e 1 of 51Web Service Definition Lan
g
ua
g
e
(
WSDL
)
16/8/2004htt
p
://www.w3.or
g
/TR/wsdl
This draft represents the current thinking with regard to descriptions of services
within Ariba, IBM and Microsoft. It consolidates concepts found in NASSL, SCL,
and SDL (earlier proposals in this space).
This document is a NOTE made available by the W3C for discussion only.
Publication of this Note by W3C indicates no endorsement by W3C or the W3C
Team, or any W3C Members. W3C has had no editorial control over the
preparation of this Note. This document is a work in progress and may be
updated, replaced, or rendered obsolete by other documents at any time.
A list of current W3C technical documents can be found at the Technical Reports
page.
Table of Contents
1 Introduction.
1.1 WSDL Document Example
1.2 Notational Conventions
2 Service Definition
2.1 Document Structure
2.1.1 Document Naming and Linking
2.1.2 Authoring Style
2.1.3 Language Extensibility and Binding
2.1.4 Documentation
2.2 Types
2.3 Messages
2.3.1 Message Parts
2.3.2 Abstract vs. Concrete Messages
2.4 Port Types
2.4.1 One-way Operation
2.4.2 Request-response Operation.
2.4.3 Solicit-response Operation
2.4.4 Notification Operation
2.4.5 Names of Elements within an Operation
2.4.6 Parameter Order within an Operation
2.5 Bindings
2.6 Ports
2.7 Services
3 SOAP Binding
3.1 SOAP Examples
3.2 How the SOAP Binding Extends WSDL
3.3 soap:binding
3.4 soap:operation
3.5 soap:body
3.6 soap:fault
3.7 soap:header and soap:headerfault
Pa
g
e 2 of 51Web Service Definition Lan
g
ua
g
e
(
WSDL
)
16/8/2004htt
p
://www.w3.or
g
/TR/wsdl
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Pré-visualização parcial do texto

Baixe Nota sobre WSDL: Endereços SOAP e Bindings HTTP e MIME e outras Notas de estudo em PDF para Análise de Sistemas de Engenharia, somente na Docsity!

This version: W3C Note 15 March 20011.1Web Services Description Language (WSDL)

http://www.w3.org/TR/2001/NOTE-wsdl-

Latest version:

http://www.w3.org/TR/wsdl

Authors (alphabetically):

Sanjiva Weerawarana, IBM ResearchGreg Meredith, MicrosoftFrancisco Curbera, IBM Research Erik Christensen, Microsoft

acknowledged Submissions, please see Acknowledged Submissions to W3C.services for the W3C XML Activity on XML Protocols. For a full list of allSubmission Request, W3C Staff Comment) as a suggestion for describingThis document is a submission to the World Wide Web Consortium (seeStatushow to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.communicate, however, the only bindings described in this document describeregardless of what message formats or network protocols are used toWSDL is extensible to allow description of endpoints and their messagesRelated concrete endpoints are combined into abstract endpoints (services).bound to a concrete network protocol and message format to define an endpoint.information. The operations and messages are described abstractly, and thenoperating on messages containing either document-oriented or procedure-orientedWSDL is an XML format for describing network services as a set of endpointsAbstractCopyright© 2001 Ariba, International Business Machines Corporation, Microsoft

Page 1 of 51

3.7 soap:header and soap:headerfault3.6 soap:fault3.5 soap:body3.4 soap:operation3.3 soap:binding3.2 How the SOAP Binding Extends WSDL3.1 SOAP Examples3 SOAP Binding2.7 Services2.6 Ports2.5 Bindings2.4.6 Parameter Order within an Operation2.4.5 Names of Elements within an Operation2.4.4 Notification Operation2.4.3 Solicit-response Operation2.4.2 Request-response Operation.2.4.1 One-way Operation2.4 Port Types2.3.2 Abstract vs. Concrete Messages2.3.1 Message Parts2.3 Messages2.2 Types2.1.4 Documentation2.1.3 Language Extensibility and Binding2.1.2 Authoring Style2.1.1 Document Naming and Linking2.1 Document Structure2 Service Definition1.2 Notational Conventions1.1 WSDL Document Example1 Introduction.Table of Contentspage.A list of current W3C technical documents can be found at the Technical Reportsupdated, replaced, or rendered obsolete by other documents at any time.preparation of this Note. This document is a work in progress and may beTeam, or any W3C Members. W3C has had no editorial control over thePublication of this Note by W3C indicates no endorsement by W3C or the W3CThis document is a NOTE made available by the W3C for discussion only.and SDL (earlier proposals in this space).within Ariba, IBM and Microsoft. It consolidates concepts found in NASSL, SCL, This draft represents the current thinking with regard to descriptions of services

Page 2 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

A WSDL document definesautomating the details involved in applications communication.definitions provide documentation for distributed systems and serve as a recipe forcommunication endpoints capable of exchanging messages. WSDL servicedefining an XML grammar for describing network services as collections ofthe communications in some structured way. WSDL addresses this need bycommunity, it becomes increasingly possible and important to be able to describeAs communications protocols and message formats are standardized in the web1. IntroductionA 4.4 MIME Binding SchemaA 4.3 HTTP Binding SchemaA 4.2 SOAP Binding SchemaA 4.1 WSDL SchemaA 4 SchemasA 3 Location of Extensibility ElementsA 2.1 Example 1A 2 Wire format for WSDL examplesA 1.3 Generating URIsA 1.2 Relative URIsA 1.1 XML namespaces & schema locationsA 1 Notes on URIs6 References5.6 mime:mimeXml5.5 soap:body5.4 mime:multipartRelated5.3 mime:content5.2 How the MIME Binding extends WSDL5.1 MIME Binding example5 MIME Binding4.7 http:urlReplacement4.6 http:urlEncoded4.5 http:operation4.4 http:binding4.3 http:address4.2 How the HTTP GET/POST Binding Extends WSDL4.1 HTTP GET/POST Examples4 HTTP GET & POST Binding3.8 soap:address

services

as collections of network endpoints, or

ports

of abstract definitions:their concrete network deployment or data format bindings. This allows the reuseIn WSDL, the abstract definition of endpoints and messages is separated from

messages

, which are abstract descriptions of the data

being exchanged, and

port types

which are abstract collections of

operations

The concrete protocol and data format specifications for a particular port type

Page 3 of 51

constitutes a reusable

binding^

. A port is defined by associating a network address

document uses the following elements in the definition of network services:with a reusable binding, and a collection of ports define a service. Hence, a WSDL

z

Types

  • a container for data type definitions using some type system (such

as XSD).

z

Message

  • an abstract, typed definition of the data being communicated.

z

Operation

  • an abstract description of an action supported by the service.

z

Port Type

–an abstract set of operations supported by one or more

endpoints.

z

Binding

  • a concrete protocol and data format specification for a particular

port type.

z

Port

  • a single endpoint defined as a combination of a binding and a network

address.

z

Service

  • a collection of related endpoints.

In addition, WSDL defines a commonlanguages via extensibility.message formats present and future, WSDL allows using other type definitionis unreasonable to expect a single type system grammar to be used to describe allSchemas specification (XSD) [11] as its canonical type system. However, since itneed for rich type systems for describing message formats, and supports the XMLWSDL does not introduce a new type definition language. WSDL recognizes theThese elements are described in detail in Section 2. It is important to observe that

binding

mechanism. This is used to attach

specificIn addition to the core service definition framework, this specification introducesor endpoint. It allows the reuse of abstract definitions.a specific protocol or data format or structure to an abstract message, operation,

binding extensions

for the following protocols and message formats:

z

SOAP 1.1 (see Section 3)

z

HTTP GET / POST (see Section 4)

z

MIME (see Section 5)

of the elements used in this definition can be found in Section 2 (core language)ticker symbol of type string, and returns the price as a float. A detailed descriptionwhich is deployed using the SOAP 1.1 protocol over HTTP. The request takes astock quotes. The service supports a single operation called GetLastTradePrice,The following example shows the WSDL definition of a simple service providing1.2 WSDL Document Examplebinding extensions with WSDL.on top of the core service definition framework. Nothing precludes the use of otherAlthough defined within this document, the above language extensions are layered

Page 4 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

3. This specification uses an

informal syntax

to describe the XML grammar of a

WSDL document:

namespace (like ##other in XSD).^ z^ <-- extensibility element --> is a placeholder for elements from some "other"particular interest in an example.^ z^ Grammar in bold has not been introduced earlier in the document, or is ofindicate that elements/attributes irrelevant to the context are being omitted.^ z^ Elements names ending in "…" (such as or )"*" (0 or more), "+" (1 or more).^ z^ Characters are appended to elements and attributes as follows: "?" (0 or 1),types instead of values.^ z^ The syntax appears as an XML instance, but the values indicate the data

soapenv

http://schemas.xmlsoap.org/soap/envelope/

1.1 [8].defined by SOAPnamespace asEnvelope

xsi

instancehttp://www.w3.org/2000/10/XMLSchema-

[10].defined by XSDnamespace asInstance

xsd

http://www.w3.org/2000/10/XMLSchema

[10].defined by XSDnamespace asSchema

tns

(various)

document.to the currentconvention to referprefix is used as anamespace” (tns)The “this

(other)

(various)

URI [4].context-dependentdependent orapplication-represent some“http://example.com”starting withparticular, URIsare samples only. Innamespace prefixesAll other

Page 7 of 51

z

namespace of the element being defined.The XML namespace prefixes (defined above) are used to indicate the

z

information to be specified in order to conform.specification; others examples are fragments and require additionalExamples starting with

(^) name="nmtoken">

(^) name="nmtoken">*

?

(^) name="nmtoken"?

(^) message="qname">?

(^) name="nmtoken"

(^) message="qname">

Page 8 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

(^) *

(^) *

(^) name="nmtoken">

(^) name="nmtoken">

<-- (^) extensibility

(^) element

(^) -->

<-- (^) extensibility

(^) element

(^) --> (^) *

Services are defined using six major elements:

types^ z^

, which provides data type definitions used to describe the messages

message^ z^ exchanged.

, which represents an abstract definition of the data being

z portType with a definition within some type system.transmitted. A message consists of logical parts, each of which is associated

, which is a set of abstract operations. Each operation refers to an

z binding input message and output messages.

, which specifies concrete protocol and data format specifications for

z port the operations and messages defined by a particular portType.

, which specifies an address for a binding, thus defining a single

service^ z^ communication endpoint.

, which is used to aggregate a set of related ports.

section we describe the rules introduced by WSDL for naming documents,These elements will be described in detail in Sections 2.2 to 2.7. In the rest of this

Page 9 of 51

WSDL documents can be assigned an optional 2.1.1 Document Naming and Linking contextual documentation. referencing document definitions, using language extensions and adding

name

attribute of type NCNAME

targetNamespace that serves as a lightweight form of documentation. Optionally, a

attribute of type URI may be specified. The URI MUST NOT be

WSDL allows associating aa relative URI.

namespace

with a document

location

using an

import

statement:

**

definitions contained in a WSDL document may be referenced: A reference to a WSDL definition is made using a QName. The following types of

z

WSDL definitions: service, port, message, bindings, and portType

z

SHOULD use QName linking.Other definitions: if additional definitions are added via extensibility, they

Each WSDL definition type listed above has its own

name scope

(i.e. port names

The use of the 2.1.2 Authoring Style described by the XML Schemas specification [11].The resolution of QNames in WSDL is similar to the resolution of QNamesunique within the WSDL document.and message names never conflict). Names within a name scope MUST be

import

element allows the separation of the different elements of a

Example 2. Alternative authoring style for the service in Example 1. language extensions can be encoded and reused in a similar fashion.defined in this specification. Other types of definitions based on additionaldefinitions explicitly presented in the example, which uses only language elementsspecific service bindings. The use of this mechanism is of course not limited to thethe definitions in three documents: data type definitions, abstract definitions, andauthoring style to define the service presented in Example 1. Here we separatethis way are easier to use and maintain. Example 2 below shows how to use thisreuse service definitions of all kinds. As a result, WSDL documents structured indefinitions according to their level of abstraction. It also maximizes the ability toneeded. This technique helps writing clearer service definitions, by separating theservice definition into independent documents, which can then be imported as

Page 10 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

WSDL uses the optional 2.1.4 Documentation the base WSDL specification.See Sections 3, 4, and 5 for examples of extensibility elements defined as part ofWSDL extensions used to describe those protocols or formats.recommends that specifications defining such protocols also define any necessaryprotocols without having to revise the base WSDL specification. WSDLExtensibility elements allow innovation in the area of network and message

wsdl:document

element as a container for human

The2.2 Typeslanguage element.("mixed" in XSD). The documentation element is allowed inside any WSDLreadable documentation. The content of the element is arbitrary text and elements

types^

element encloses data type definitions that are relevant for the

intrinsic type system.WSDL prefers the use of XSD as the canonical type system, and treats it as theexchanged messages. For maximum interoperability and platform neutrality,

is as follows:these cases, the recommended approach for encoding abstract types using XSDbut that binding type does not already have a type system in widespread use. Inthere will be multiple bindings for the same message, or if there is only one bindingXSD schema validates the particular wire format. This is especially interesting ifwhether or not the resulting wire format is actually XML, or whether the resulting The XSD type system can be used to define the types in a message regardless of

soapenc:arrayType attribute. At the time of this writing, the XSDand the array dimensions are specified by using a default value for theXXX is the type of the items in the array). The type of the items in the arraySOAP v1.1 document). Use the name ArrayOfXXX for array types (wherethe resulting form actually uses the encoding specified in Section 5 of theschema (http://schemas.xmlsoap.org/soap/encoding/) (regardless of whether^ z^ Array types should extend the Array type defined in the SOAP v1.1 encodingexamples are soap:root, soap:encodingStyle, xmi:id, xmi:name.(e.g. have nothing to do with the abstract content of the message). Some^ z^ Don't include attributes or elements that are peculiar to the wire encoding^ z^ Use element form (not attribute).

Page 13 of 51

WSDL introduces thean attribute which contains a QName value. To overcome this limitation, specification does not have a mechanism for specifying the default value of

arrayType^

attribute (from namespace

WSDL.mechanism SHOULD be used in favor of the arrayType attribute defined bydefault value. If XSD is revised to support this functionality, the revisedhttp://schemas.xmlsoap.org/wsdl/) which has the semantic of providing the

z

type.Use the xsd:anyType type to represent a field/parameter which can have any

theto be added via extensibility elements. An extensibility element may appear underused to describe all abstract types present and future, WSDL allows type systemsHowever, since it is unreasonable to expect a single type system grammar can be

types

element to identify the type definition system being used and to provide

compared to that of thean XML container element for the type definitions. The role of this element can be

schema

element of the XML Schema language.

<-- (^) type-system

(^) extensibility

(^) element

(^) --> (^) *

Messages consist of one or more logical 2.3 Messages

parts

. Each part is associated with a type

attributes for use with XSD:typing attributes is extensible. WSDL defines several such message-typingfrom some type system using a message-typing attribute. The set of message-

z

element

. Refers to an XSD element using a QName.

z

type

. Refers to an XSD simpleType or complexType using a QName.

(which may vary depending on the type system used) are shown inThe syntax for defining a message is as follows. The message-typing attributesmessage-typing attributes.different from that of WSDL. Binding extensibility elements may also useOther message-typing attributes may be defined as long as they use a namespace

bold

The message

name^

attribute provides a unique name among all messages

defined within the enclosing WSDL document.

Page 14 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

The part

name^

attribute provides a unique name among all the parts of the

example, the following message consists of a Purchase Order and an Invoice.Multiple part elements are used if the message has multiple logical units. Formust be inspected in order to determine the actual meaning of the part.RPC, a part MAY represent a parameter in the message. However, the bindingsspecific information about the part. For example, if defining a message for use withmessage. A binding may reference the name of a part in order to specify binding- Parts are a flexible mechanism for describing the logical abstract content of a 2.3.1 Message Parts enclosing message.

(^) name="Item">

(^) name="Invoice"

(^) type="tns:InvoiceType"/>

(^) name="PO">

Page 15 of 51

following example, the body is either a purchase order, or a set of invoices.type system directly. In this usage, only one part may be specified. In thesyntax may be used to specify the composite structure of the message using the However, if the message contents are sufficiently complex, then an alternative

(^) name="Item">

(^) name="InvoiceType">

**

(^) name="Composite">

**

mapped into a concrete format. However, in some cases, the abstract definitionmessage content. A message binding describes how the abstract content is Message definitions are always considered to be an abstract definition of the 2.3.2 Abstract vs. Concrete Messages

Page 16 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

The grammar for a solicit-response operation is:

The grammar for a notification operation is: 2.4.4 Notification Operation communications (such as two HTTP requests).single communication (such as a HTTP request/response), or as two independentmust be consulted to determine how the messages are actually sent: within aNote that a solicit-response operation is an abstract notion; a particular bindingresult of the operation (beyond those specific to the protocol).the abstract message format for any error messages that may be output as thesolicited request and response, respectively. The optional fault elements specify The output and input elements specify the abstract message format for the

**

The

output^

element specifies the abstract message format for the notification

The 2.4.5 Names of Elements within an Operation operation.

name

attribute of the input and output elements provides a unique name

appended, respectively.name defaults to the name of the operation with "Request"/"Solicit" or "Response"input or output messages of a request-response or solicit-response operation, thedefaults to the name of the operation. If the name attribute is not specified on thethe name attribute is not specified on a one-way or notification message, itoperation, WSDL provides some default values based on the operation name. IfIn order to avoid having to name each input and output element within anamong all input and output elements within the enclosing port type.

Page 19 of 51

parameterOrder or solicit-response operation MAY specify a list of parameter names via theto capture the original RPC function signature. For this reason, a request-responsenot. However, when using an operation with an RPC-binding, it is useful to be able Operations do not specify whether they are to be used with RPC-like bindings or 2.4.6 Parameter Order within an Operation of faults defined for the operation.format of the fault message. The name of the fault element is unique within the set Each fault element must be named to allow a binding to specify the concrete

attribute (of type nmtokens). The value of the attribute is a list of

parameterOrder attribute MUST follow the following rules:message part names separated by a single space. The value of the

z

signatureThe part name order reflects the order of the parameters in the RPC

z

The

return

value part is not present in the list

z

If a part name appears in both the input and output message, it is an

in/out

parameter

z

If a part name appears in only the input message, it is an

in

parameter

z

If a part name appears in only the output message, it is an

out

parameter

for a given portType. The grammar for a binding is as follows:messages defined by a particular portType. There may be any number of bindingsA binding defines message format and protocol details for operations and2.5 Bindingsthe operation is to be used with an RPC-like binding.not concerned with RPC signatures. Also, it is not required to be present, even ifNote that this information serves as a "hint" and may safely be ignored by those **

(^) extensibility

(^) element

(^) extensibility

(^) element

(^) (2) (^) --> (^) *****

(^) name="nmtoken"?

(^) extensibility

(^) element

(^) (4) (^) --> (^) *****

(^) name="nmtoken">

(^) extensibility

(^) element

(^) (5) (^) --> (^) *****

Page 20 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

The

name^

attribute provides a unique name among all bindings defined within in

A binding references the portType that it binds using thethe enclosing WSDL document.

type^

attribute. This

be identified by providing theenough to uniquely identify an operation. In that case, the correct operation shouldmethod names), the name attribute in the operation binding element might not benames are not required to be unique (for example, in the case of overloading ofoperation with the same name within the binding's portType. Since operationAn operation element within a binding specifies binding information for theas well as per-binding information (1) may also be specified.input (3), output (4), and fault messages (5). Per-operation binding information (2)Binding extensibility elements are used to specify the concrete grammar for theQName value follows the linking rules defined by WSDL (see section 2.1.2).

name

attributes of the corresponding wsdl:input and

A port defines an individual endpoint by specifying a single address for a binding.2.6 PortsA binding MUST NOT specify address information.A binding MUST specify exactly one protocol.wsdl:output elements. **

(^) extensibility

(^) element

(^) (1) (^) -->

The

name

attribute provides a unique name among all ports defined within in the

Theenclosing WSDL document.

binding

attribute (of type QName) refers to the binding using the linking rules

A port MUST NOT specify any binding information other than address information.A port MUST NOT specify more than one address.the port.Binding extensibility elements (1) are used to specify the address information fordefined by WSDL (see Section 2.1.2).

Page 21 of 51

A service groups a set of related ports together: 2.7 Services

**

The

name

attribute provides a unique name among all services defined within in

Ports within a service have the following relationship:the enclosing WSDL document.

z

not the input of another).None of the ports communicate with each other (e.g. the output of one port is

z

criteria (protocol, distance, etc.).document to choose particular port(s) to communicate with based on somelimitations imposed by each binding). This allows a consumer of a WSDLsemantically equivalent behavior (within the transport and message formatbindings or addresses, the ports are alternatives. Each port providesIf a service has several ports that share a port type, but employ different

z

to accomplish a particular task.the port types, and that the entire set of port types must be present in orderThis is useful if there is some implied relationship between the operations ofto a particular service based whether or not it supports several port types.a consumer of a WSDL document to determine if it wishes to communicateBy examining it's ports, we can determine a service's port types. This allows

specification of the following protocol specific information:WSDL includes a binding for SOAP 1.1 endpoints, which supports the3. SOAP Binding

z

An indication that a binding is bound to the SOAP 1.1 protocol

z

A way of specifying an address for a SOAP endpoint.

z

The URI for the SOAPAction HTTP header for the HTTP binding of SOAP

z

EnvelopeA list of definitions for Headers that are transmitted as part of the SOAP

from portions of this grammar. For example:bindings is evolving. Nothing precludes additional SOAP bindings to be derivedThis binding grammar it is not an exhaustive specification since the set of SOAP

z

SOAP bindings that do not employ a URI addressing scheme may substitute

Page 22 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

encodingStyle="http://schemas.xmlsoap.org/soap

>

(^) name="StockQuoteService">

My

(^) first (^) service

Example 5. SOAP binding of request-response RPC operation over HTTP frequency, and returns an array of floats.parameters tickerSymbol and timePeriod followed by the output parameterSOAP response. The RPC signature that corresponds to this service has inthat period of time, as well as the frequency at which they were recorded as theand end time and returns an array of stock prices recorded by the service withinquote symbol string, an application defined TimePeriod structure containing a startStockQuote service via the SOAP 1.1 HTTP binding. The request takes a stock This example describes that a GetTradePrices SOAP 1.1 request may be sent to a

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:xsd1="http://example.com/stockquote/schema"xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"xmlns:tns="http://example.com/stockquote.wsdl"

(^) targetNamespace="http://example.com/stockquote/schema"

** **

(^) name="ArrayOfFloat">

** **

Page 25 of 51

(^) name="GetTradePricesOutput">

(^) name="StockQuotePortType">

(^) name="StockQuoteSoapBinding"

(^) type="tns:StockQuotePortType">

>

(^) name="StockQuoteService">

My

(^) first

(^) service

The SOAP Binding extends WSDL with the following extension elements: 3.2 How the SOAP Binding Extends WSDL

?**

** encodingStyle="uri-list"?

(^) namespace="uri"?>*

(^) .... (^) >

The soap:binding element MUST be present when using the SOAP binding.section 5 of the SOAP 1.1 specification).claims as to the encoding or format of the message (e.g. that it necessarily followsthe SOAP protocol format: Envelope, Header and Body. This element makes noThe purpose of the SOAP binding element is to signify that the binding is bound to3.3 soap:binding Each extension element of the SOAP binding is covered in subsequent sections. **

The value of the

style

attribute is the default for the style attribute for each

The value of the required"document". See section 3.4 for more information on the semantics of style.contained operation. If the style attribute is omitted, it is assumed to be

transport

attribute indicates which transport of SOAP

http://schemas.xmlsoap.org/soap/http this binding corresponds to. The URI value

corresponds to the HTTP binding in the

SOAP specification. Other URIs may be used here to indicate other transports

Page 27 of 51

The soap:operation element provides information for the operation as a whole.3.4 soap:operation (such as SMTP, FTP, etc.).

?**

The

style^

attribute indicates whether the operation is RPC-oriented (messages

The"document".element. If the soap:binding element does not specify a style, it is assumed to bethe attribute is not specified, it defaults to the value specified in the soap:bindingBody of the SOAP message is constructed, as explained in Section 3.5 below. Ifprogramming model. The value of this attribute also affects the way in which thecontaining document(s)). This information may be used to select an appropriatecontaining parameters and return values) or document-oriented (message

soapAction

attribute specifies the value of the SOAPAction header for this

"writer makes right".case, the writer of the message must conform exactly to the specified schema:concretely and then indicate it’s original encoding style (if any) as a hint. In thisright". To avoid having to support all variations, a message may be definedreader of the message to understand all the format variations: "reader makesvariation in the message format for a given set of abstract types, it is up to thesuch as the SOAP Encoding (http://schemas.xmlsoap.org/soap/encoding/) allowusing a list of URIs, as in the SOAP specification. Since some encoding stylessome set of rules defined by an encoding style. Each encoding style is identifiedschema definitions. If abstract definitions, the types are serialized according toThe parts of a message may either be abstract type definitions, or concreteBody element.The soap:body element specifies how the message parts appear inside the SOAP3.5 soap:bodyspecified, and the soap:operation element MAY be omitted.(it has no default value). For other SOAP protocol bindings, it MUST NOT bemaking the request. For the HTTP protocol binding of SOAP, this is value requiredheader; no attempt should be made to make a relative URI value absolute whenoperation. This URI value should be used directly as the value for the SOAPAction

Page 28 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

not required to list those headers here.WSDL may imply specific headers should be added to the actual payload and it isEnvelope using soap:header. For example, extensions (see section 2.1.3) toIt is not necessary to exhaustively list all headers that appear in the SOAPafter the soap:body element (see section 3.5).are transmitted inside the Header element of the SOAP Envelope. It is patternedThe soap:header and soap:headerfault elements allows header to be defined that

(^) message="qname"

(^) part="nmtoken"

(^) use="literal|en

encodingStyle="uri-list"?

(^) namespace="uri"?>*

**

protocol specific information may be specified:applications other than Web Browsers to interact with the site. The followingdescribe the interaction between a Web Browser and a web site. This allowsWSDL includes a binding for HTTP 1.1's GET and POST verbs in order to 4. HTTP GET & POST Binding

z

An indication that a binding uses HTTP GET or POST

z

An address for the port

z

by the port)A relative address for each operation (relative to the base address defined

be as follows for each port:If the values being passed are part1=1, part2=2, part3=3, the request format wouldtype.The following example shows three ports that are bound differently for a given port4.1 HTTP GET/POST Examples port1: (^) GET, (^) URL="http://example.com/o1/A1B2/3"

port2: (^) GET, (^) URL="http://example.com/o1?p1=1&p2=2&p3=

port3: (^) POST,

(^) URL="http://example.com/o1",

(^) PAYLOAD="p1=1&p2=2&p3=3"

Example 6. GET and FORM POST returning GIF or JPG For each port, the response is either a GIF or a JPEG image.

(^) name="m2">

Page 32 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

(^) name="pt1">

(^) name="service1">

(^) name="port2"

(^) binding="tns:b2">

(^) name="port3"

(^) binding="tns:b3">

(^) name="b1"

(^) type="pt1">

(^) name="b2"

(^) type="pt1">

** **

** **

(^) name="b3"

(^) type="pt1">

Page 33 of 51

elements:The HTTP GET/POST Binding extends WSDL with the following extension 4.2 How the HTTP GET/POST Binding Extends WSDL

**

(^) mime (^) elements

(^) .... (^) >

(^) mime (^) elements

(^) .... (^) >

The4.3 http:address These elements are covered in the subsequent sections.

location^

attribute specifies the base URI for the port. The value of the

The4.4 http:bindingbinding element. See section 4.5 for more details.attribute is combined with the values of the location attribute of the http:operation

http:binding

element indicates that this binding uses the HTTP protocol.

Page 34 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

(^) name="ArrayOfBinary">

(^) name="m1">

(^) name="m2">

(^) name="pt1">

(^) name="b1"

(^) type="tns:pt1">

**

**

** **

** **

(^) name="CompanyInfoService">

Page 37 of 51

The MIME Binding extends WSDL with the following extension elements: 5.2 How the MIME Binding extends WSDL

(^) mime (^) element

(^) part="nmtoken"?/>

They are used at the following locations in WSDL:

(^) mime (^) elements

(^) .... (^) >

(^) mime (^) elements

mime:content To avoid having to define a new element for every MIME format, the5.3 mime:contentmultiple appear, they are considered to be alternatives. MIME elements appear under input and output to specify the MIME format. If

element may be used if there is no additional information to convey

about the format other than its MIME type string.

The

part^

attribute is used to specify the name of the message part. If the message

has a single part, then the part attribute is optional. The

type

attribute contains the

which may be a wildcard (*). Not specifying the type attribute indicates that allMIME type string. A type value has two portions, separated by a slash (/), either of

Page 38 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl

generic mime element can be used indicating text/xml:If the return format is XML, but the schema is not known ahead of time, theMIME types are acceptable.

types. A wildcard (*) can be used to specify a family of mime types, for example all text

The following two examples both specify all mime types:

mime:multipartRelated parts into one message using the MIME type "multipart/related". TheThe multipart/related MIME type aggregates an arbitrary set of MIME formatted 5.4 mime:multipartRelated

element describes the concrete format of such a

message:

(^) mime (^) element

(^) -->

The

mime:part

element describes each part of a multipart/related message. MIME

elements appear within

mime:part^

to specify the concrete MIME type for the part.

Envelope), but do have a particular schema, theTo specify XML payloads that are not SOAP compliant (do not have a SOAP5.6 mime:mimeXmlan enclosing SOAP Envelope.element as a MIME element. It indicates the content type is "text/xml", and there isWhen using the MIME binding with SOAP requests, it is legal to use the soap:body5.5 soap:bodyIf more than one MIME element appears inside a mime:part, they are alternatives.

mime:mimeXml^

element may be

used to specify that concrete schema. The

part

attribute refers to a message part

omitted if the message has only a single part. The part references a concretedefining the concrete schema of the root XML element. The part attribute MAY be

Page 39 of 51

schema using the

element^

attribute for simple parts or

type^

attribute for composite

parts (see section 2.3.1).

or the value of theIt is a common misperception to equate the targetNamespace of an XML schemaA 1.1 XML namespaces & schema locationsbackground that may be useful when implementing the specification.This section does not directly contribute to the specification, but provideA 1. Notes on URIsprogress.[11] W3C Working Draft "XML Schema Part 2: Datatypes". This is work inprogress.[10] W3C Working Draft "XML Schema Part 1: Structures". This is work inSOAP-20000508/"[8] Simple Object Access Protocol (SOAP) 1.1 "http://www.w3.org/TR/2000/NOTE-[7] http://www.w3.org/TR/html401/interact/forms.html - h-17.13.4[6] http://www.w3.org/TR/html401/appendix/notes.html - ampersands-in-uris[5] http://www.w3.org/TR/html401/interact/forms.html - submit-format1998.Generic Syntax", RFC 2396, MIT/LCS, U.C. Irvine, Xerox Corporation, August[4] T. Berners-Lee, R. Fielding, L. Masinter, "Uniform Resource Identifiers (URI):2119, Harvard University, March 1997[2] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels", RFC 6. References

xmlns

attribute in XML instances with the location of the

context. The WSDL specification provides the processing context here via theprocessor of XML to determine which one to use in a particular processingbe multiple schemas associated with a particular namespace, and it is up to amean that is the only schema that is associated with that namespace. There canlocations, and you may be able to retrieve a schema from that location, it does notcorresponding schema. Since namespaces are in fact URIs, and URIs may be

mechanism, which is based on the XML schemas grammar for the

Page 40 of 51

Web Service Definition Language (WSDL)

http://www.w3.org/TR/wsdl