API / Web services
Difference between RPC and document style web service implementation of JAX-RS.
In document style web services, we can transport an XML message as part of the SOAP request whereas in RPC style web service it is not possible.
Document style web service is most appropriate in some application where XML message behaves as document and content of that document can alter and intention of web service does not rely on the content of XML message.
| RPC Style | Document Style |
|---|---|
| RPC style web services use method name and parameters to generate XML structure. | |
| In RPC style, the generated WSDL is difficult to be validated against schema. | Document style web services can be validated against predefined schema. |
| In RPC style, SOAP message is sent as many elements. | In document style, SOAP message is sent as a single document. |
| RPC style message is tightly coupled. | Document style message is loosely coupled. |
| In RPC style, SOAP message keeps the operation name. | In Document style, SOAP message loses the operation name. |
| The parameters are sent as discrete values. | The parameters are sent in XML format. |
| RPC style doesnÂt specify the types in WSDL file. | Document style specify the types. |
| It defines name and type attribute for message part. | It defines name and element attribute for message part. |
| For soap:body, it defines use and namespace attributes. | For soap:body, it defines use attribute only. |
More Related questions...