この項目では、Web サービス記述言語 (WSDL) ファイルのアーキテクチャーについて説明します。
WSDL ファイルは Extensible Markup Language (XML) で作成されています。 XML の詳細については、『Web サービス: 学習用リソース』を参照してください。
WSDL ファイル内の情報は次のような構造になっています。
ここには、エレメントとネーム・スペースが含まれます。
ここには、サービスおよびポートの定義が含まれます。
WSDL ファイルは以下のエレメントで Web サービスを記述します。
操作および関連メッセージの説明。portType エレメントは、 要約操作を定義します。
<portType name="EightBall"> <operation name="getAnswer"> <input message="ebs:IngetAnswerRequest"/> <output message="ebs:OutgetAnswerResponse"/> </operation> </portType>
入出力パラメーターおよび戻り値の説明。
<message name="IngetAnswerRequest"> <part name="meth1_inType" type="ebs:questionType"/> </message> <message name="OutgetAnswerResponse"> <part name="meth1_outType" type="ebs:answerType"/> </message>
メッセージ内で使用される XML 型を記述するためのスキーマ。
<types> <xsd:schema targetNamespace="..."> <xsd:complexType name="questionType"> <xsd:element name="question" type="string"/> </xsd:complexType> <xsd:complexType name="answerType"> ... </types>
バインディングは、portType と、 特定の portType エレメントにより定義されたメッセージ用データ・フォーマットにアクセスするために使用するプロトコルを記述します。
<binding name="EightBallBinding" type="ebs:EightBall"> <soap:binding style="rpc" transport="schemas.xmlsoap.org/soap/http"> <operation name="ebs:getAnswer"> <soap:operation soapAction="urn:EightBall"/> <input> <soap:body namespace="urn:EightBall" ... /> ...
サービスおよびポートで、その Web サービスのロケーションが定義されます。
<service name="EightBall"> <port binding="ebs:EightBallBinding" name="EightBallPort"> <soap:address location="localhost:8080/axis/EightBall"/> </port> </service>