9.6. RPC/Literal

RPC ではエンドポイント操作に名前を付けるラッパー要素があります。 親 RPC の子要素は個別のパラメーターです。 SOAP ボディーは次のような簡単なルールによって構築されます。
  • ポートタイプ操作名がエンドポイントメソッド名を定義する。
  • メッセージ部分はエンドポイントメソッドパラメーターである。
TPC は SOAP バインディングのスタイル属性によって定義されます。
<binding name='EndpointInterfaceBinding' type='tns:EndpointInterface'>
   <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
   <operation name='echo'>
      <soap:operation soapAction=''/>
      <input>
         <soap:body namespace='http://org.jboss.ws/samples/jsr181pojo' use='literal'/>
      </input>
      <output>
         <soap:body namespace='http://org.jboss.ws/samples/jsr181pojo' use='literal'/>
      </output>
   </operation>
</binding>
RPC スタイルの Web サービスでは、 portType が操作の名前を付けます (例: エンドポイント上の java メソッド)。
<portType name='EndpointInterface'>
   <operation name='echo' parameterOrder='String_1'>
      <input message='tns:EndpointInterface_echo'/>
      <output message='tns:EndpointInterface_echoResponse'/>
   </operation>
</portType>
個別のメッセージ部分によって操作パラメーターが定義されます。
<message name='EndpointInterface_echo'>
   <part name='String_1' type='xsd:string'/>
</message>
<message name='EndpointInterface_echoResponse'>
   <part name='result' type='xsd:string'/>
</message>

注記

SOAP メッセージペイロード全体を認証できる複雑なタイプは、 XML スキーマにはありません。
@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class JSEBean01
{
   @WebMethod
   @WebResult(name="result")
   public String echo(@WebParam(name="String_1") String input)
   {
   ...
   }
}
RPC パラメーターの要素名は JAX-WS Annotations#javax.jws.WebParam、 RPC 戻り値の要素名は JAX-WS Annotations#javax.jws.WebResult を使用して定義することができます。