Introduction
JAX-WS or Java API for XML Web Services is a set of APIs to create web services and clients that communicate through XML. It allows the use of Document-oriented and Remote Procedure Call-oriented web services. RPC and Document-oriented web services involve SOAP messages containing XML data. Let us explore the key differences between them.

Remote Procedure Call
RPC or Remote Procedure Call is used to construct distributed, client-server-based applications. One procedure calls another procedure, both existing in different address spaces. The RPC protocol is helpful when the process has no access to another computer's network details and the service is requested on a different computer. In this client-server model, the arguments are passed to a remote procedure, and the client calls the server.
JAX-WS RCP can invoke a Java-based Web service with a known description and a consistent WSDL description. The SOAP messages body contains an XML representation of the method's call. The method name and parameters construct an XML tree representing the method's call stack.
“Also Read About, procedure call in compiler design“





