コンテンツにスキップ

Web Services Description Language

出典: フリー百科事典『ウィキペディア(Wikipedia)』

これはこのページの過去の版です。Tomato tomato tomato (会話 | 投稿記録) による 2015年6月10日 (水) 11:31個人設定で未設定ならUTC)時点の版 (Category:長大な項目名を追加 (HotCat使用))であり、現在の版とは大きく異なる場合があります。

WSDL 1.1 文書、 WSDL 2.0 文書の定義に関する概念図

Web Services Description Language (WSDL ウィズダル) とは、Webサービス記述言語の意で、SOAPによるXML Webサービスのインタフェースを記述するインタフェース記述言語。通常その表現にはXMLを使う。

関連文書に多数の混乱があるため、まず、必ずWS-IのBasic Profileの「5. Service Description」[1]を熟読すべきである。

WSDLの構成要素

  • types
  • message
  • operation
  • portType
  • binding
  • port
  • service

WSDL ファイル サンプル

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.w3.org/ns/wsdl" 
             xmlns:tns="http://www.tmsws.com/wsdl20sample" 
             xmlns:whttp="http://schemas.xmlsoap.org/wsdl/http/"
             xmlns:wsoap="http://schemas.xmlsoap.org/wsdl/soap/"
             targetNamespace="http://www.tmsws.com/wsdl20sample">

<!-- Abstract type -->
   <types>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns="http://www.tmsws.com/wsdl20sample"
                targetNamespace="http://www.example.com/wsdl20sample">
                 
         <xs:element name="request"> ... </xs:element>
         <xs:element name="response"> ... </xs:element>
      </xs:schema>
   </types>

<!-- Abstract interfaces -->
   <interface name="Interface1">
      <fault name="Error1" element="tns:response"/>
      <operation name="Get" pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="tns:request"/>
         <output messageLabel="Out" element="tns:response"/>
      </operation>
   </interface>

<!-- Concrete Binding Over HTTP -->
   <binding name="HttpBinding" interface="tns:Interface1" 
            type="http://www.w3.org/ns/wsdl/http">
      <operation ref="tns:Get" whttp:method="GET"/>
   </binding>
   
<!-- Concrete Binding with SOAP-->
   <binding name="SoapBinding" interface="tns:Interface1" 
            type="http://www.w3.org/ns/wsdl/soap" 
            wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/"
            wsoap:mepDefault="http://www.w3.org/2003/05/soap/mep/request-response">
      <operation ref="tns:Get" />
   </binding>

<!-- Web Service offering endpoints for both bindings-->
   <service name="Service1" interface="tns:Interface1">
      <endpoint name="HttpEndpoint" 
                binding="tns:HttpBinding" 
                address="http://www.example.com/rest/"/>
      <endpoint name="SoapEndpoint" 
                binding="tns:SoapBinding" 
                address="http://www.example.com/soap/"/>
   </service>
</definitions>


関連技術

外部リンク

  1. ^ WS-I Basic Profile, 5. Service Description