Encoded vs Literal, RPC vs Document

简介: 我一直没有分清题目里所写的概念,看过JAX-RPC规范后还是模糊,原因主要是对XML本身就没有特别深入的理解。不过现在感觉好象明白了一些。 Encoded和Literal是两种Typing system,前者对应http://schemas.xmlsoap.org/soap/encoding/,后者利用XML Schema定义数据类型。

我一直没有分清题目里所写的概念,看过JAX-RPC规范后还是模糊,原因主要是对XML本身就没有特别深入的理解。不过现在感觉好象明白了一些。

Encoded和Literal是两种Typing system,前者对应http://schemas.xmlsoap.org/soap/encoding/,后者利用XML Schema定义数据类型。

“Literal对应于types中的element只有一层,Encoded对应于types中element多层的。

用Literal描述的参数客户必须提供明确的参数名,用Encoded描述的参数客户可以用param1,param2,param3等代替。”

在Axis中,使用org.apache.axis.description.OperationDesc类指定自己要使用的方式,方法如下:

“oper.setStyle(org.apache.axis.enum.Style.DOCUMENT); oper.setUse(org.apache.axis.enum.Use.LITERAL);,这个是对于document方式的,如果是rpc方式应该设置为:oper.setStyle(org.apache.axis.enum.Style.RPC); oper.setUse(org.apache.axis.enum.Use.ENCODE);”,然后还要用call.setOperation(oper);把OperationDesc对象实例和Call对象联系起来。

----赵晓冬

关于RPC和Document的比较,这里有两篇不错的文章:Operation Style (Document/RPC) and Message format(literal/encoded) ,The Difference Between RPC and Document Style WSDL

本文转自博客园八进制的博客,原文链接:Encoded vs Literal, RPC vs Document,如需转载请自行联系原博主。

相关文章
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
7月前
|
JSON JavaScript API
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 错误分析
本文探讨了Python中处理JSON数据时遇到的`JSONDecodeError`,该错误通常由JSON格式错误或数据源问题引起。解决方法包括检查数据源、使用异常处理机制和调试日志记录。示例代码展示了如何从文件和API读取JSON并处理异常。注意事项涉及验证JSON规范、处理特殊字符和选择合适解析器。通过这些步骤,可以有效解决JSON解码错误,确保数据正确解析。
588 0
|
7月前
|
JSON Java 数据格式
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
751 0
Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?)
Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?)
399 0
Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?)
|
API
JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line
JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line
160 0
|
存储 JSON Linux
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (ch
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (ch
TypeError: 'encoding' is an invalid keyword argument for this function
TypeError: 'encoding' is an invalid keyword argument for this function
274 0
|
XML Java 数据库连接
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
204 0
Open quote is expected for attribute "{1}" associated with an element type "id".
solidity中transfer异常"send" and "transfer" are only available for objects of type address
solidity中transfer异常"send" and "transfer" are only available for objects of type address
461 0