What is the difference between Document style and RPC style communication?

前端 未结 6 1163
甜味超标
甜味超标 2020-12-07 07:48

Can somebody explain to me the differences between Document and RPC style webservices? Apart from JAX-RPC, the next version is JAX-WS, which supports both Document and RPC s

6条回答
  •  既然无缘
    2020-12-07 08:27

    In WSDL definition, bindings contain operations, here comes style for each operation.

    Document : In WSDL file, it specifies types details either having inline Or imports XSD document, which describes the structure(i.e. schema) of the complex data types being exchanged by those service methods which makes loosely coupled. Document style is default.

    • Advantage:
      • Using this Document style, we can validate SOAP messages against predefined schema. It supports xml datatypes and patterns.
      • loosely coupled.
    • Disadvantage: It is a little bit hard to get understand.

    In WSDL types element looks as follows:

    
     
      
     
    
    

    The schema is importing from external reference.

    RPC :In WSDL file, it does not creates types schema, within message elements it defines name and type attributes which makes tightly coupled.

      
      
      
      
      
      
      
    
    • Advantage: Easy to understand.
    • Disadvantage:
      • we can not validate SOAP messages.
      • tightly coupled

    RPC : No types in WSDL
    Document: Types section would be available in WSDL

提交回复
热议问题