portType要素

postType要素ではmessage要素で定義したメッセージをoperation(=メソッド)要素としてまとめます。operation要素は1つのinput(入力)要素と1つのoutput(出力)要素を含みます。

WSDLでは次の4つの基本オペレーションをサポートしています。

One-Way
サービスがメッセージを受信するのみ。operation要素はinput要素を含みます。
Request-Response
サービスはリクエストメッセージを受信し、レスポンスメッセージを返す。また、エラー時に返す例外としてfault要素を定義できます。
Solicit-response
Request-Responseの逆。サービスがリクエストメッセージを送信し、クライアントがレスポンスメッセージを返す。output要素とinput要素を含みます。また、Request-Responseと同様にfault要素を含むことができます。
Notification
サービスはクライアントに通知メッセージを送信します。output要素を含みます。

SOAP-RPCでは、Request-Responseの形態をとりますのでportTypeで定義する各オペレーションはすべてinput/output要素を包含している必要があります。input/outputの属性として指定するメッセージはmessage要素で定義したQNameとなります。

<portType name="LovemacPortType">
  <operation name="ServiceStart">
    <input message="typens:ServiceStartRequest"/>
    <output message="typens:ServiceStartResponse"/>
  </operation>
  <operation name="GetItemInfo">
    <input message="typens:GetItemInfoRequest"/>
    <output message="typens:GetItemInfoResponse"/>
  </operation>
  <operation name="ServiceEnd">
    <input message="typens:ServiceEndRequest"/>
    <output message="typens:ServiceEndResponse"/>
  </operation>
</portType>