WSDL Documentation
- Previous Page WSDL Introduction
- Next Page WSDL Port
Ang WSDL dokumento ay isang simple na XML dokumento.
Ito ay naglalaman ng isang serye ng kahulugan na ilarawan ang isang web service.
WSDL Dokumentong Struktura
Ang WSDL dokumento ay ginagamit ng mga pangunahing elemente na ito upang ilarawan ang isang web service:
Element | Definition |
---|---|
<portType> | Operation na isagawa ng web service |
<message> | Mensahe na ginagamit ng web service |
<types> | Uri ng datos na ginagamit ng web service |
<binding> | Communication protocol na ginagamit ng web service |
Ang pangunahing istraktura ng isang WSDL dokumento ay parang ito:
<definitions> <types> definition of types........ </types> <message> definition of a message.... </message> <portType> definition of a port....... </portType> <binding> definition of a binding.... </binding> </definitions>
Ang WSDL dokumento ay maaaring magkaroon ng iba pang element, tulad ng extension element, at isang service element, na maaaring ipagsama-sama ang mga kahulugan ng ilang web services sa isang solong WSDL dokumento.
Para sa kumpletong paglalarawan ng syntax, mangyaring bisitahin: WSDL Syntax Ito ang section.
WSDL Port
<portType> Ang elementong ito ay pinakamahalagang WSDL element.
Ito ay naglalarawan ng web service, ang operasyon na maaaring isagawa, at ang mga mensahe na may kaugnayan.
Maaaring ikabit ang <portType> element bilang library ng function sa tradisyonal na wika ng programming (o isang module, o isang klase).
WSDL Mensahe
<message> Ang elemento ay nagtutukoy sa elemento ng datos ng isang operasyon.
Ang bawat mensahe ay binubuo ng isang o ilang bahagi. Maaaring ikabit ang mga bahagi na ito bilang argumento ng pagtawag ng function sa tradisyonal na wika ng programming.
WSDL types
<types> Ang elemento ay nagtutukoy sa uri ng datos na ginagamit ng web service.
Para sa pinakamataas na kahusayan ng platformang walang pinagkakakaiba, ang WSDL ay gumagamit ng syntax ng XML Schema upang tugisin ang uri ng datos.
WSDL Bindings
<binding> Ang elemento ay nagtutukoy sa format ng mensahe at detalye ng protokol para sa bawat port.
WSDL Instance
This is a simplified snippet of a WSDL document:
<message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>
In this example,<portType> Element defines "glossaryTerms" as a certainPortThe name, define "getTerm" as a certainOperationof the name.
The operation "getTerm" has a named "getTermRequest"Input message, and a named "getTermResponse"Output message.
<message> An element can define each message'sComponent, as well as related data types.
Compared to traditional programming, glossaryTerms is a library, and "getTerm" is a function with input parameter "getTermRequest" and return parameter getTermResponse.
- Previous Page WSDL Introduction
- Next Page WSDL Port