JBoss.org Community Documentation

9.4. RPC/Literal

With RPC there is a wrapper element that names the endpoint operation. Child elements of the RPC parent are the individual parameters. The SOAP body is constructed based on some simple rules:

  • The port type operation name defines the endpoint method name

  • Message parts are endpoint method parameters

RPC is defined by the style attribute on the SOAP binding.

 <binding name='EndpointInterfaceBinding' type='tns:EndpointInterface'>
	 <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
	 <operation name='echo'>
		 <soap:operation soapAction=''/>
			 <soap:body namespace='http://org.jboss.ws/samples/jsr181pojo' use='literal'/>
			 <soap:body namespace='http://org.jboss.ws/samples/jsr181pojo' use='literal'/>

With rpc style web services the portType names the operation (i.e. the java method on the endpoint)

 <portType name='EndpointInterface'>
		 <operation name='echo' parameterOrder='String_1'>
		 <input message='tns:EndpointInterface_echo'/>
			 <output message='tns:EndpointInterface_echoResponse'/>

Operation parameters are defined by individual message parts.

 <message name='EndpointInterface_echo'>
	 <part name='String_1' type='xsd:string'/>
 <message name='EndpointInterface_echoResponse'>
	 <part name='result' type='xsd:string'/>

Note, there is no complex type in XML schema that could validate the entire SOAP message payload.

 @SOAPBinding(style = SOAPBinding.Style.RPC)
 public class JSEBean01
 public String echo(@WebParam(name="String_1") String input)

The element names of RPC parameters/return values may be defined using the JAX-WS Annotations#javax.jws.WebParam and JAX-WS Annotations#javax.jws.WebResult respectively.