lz 说的是啥风格的 web Service ?REST 风格的web service 采用的传输协议是 http 返回值得看具体返回值的类型, 一般是纯文本 ,当然也可以返回 xml json 等其他格式的数据其他的就不知道了。
SOAP也是基于http的呀。远程调用rmi才有可能是走的自己的协议。
我们说的web service通常是SOA(service-oriented architecture),当然还有REST等Web services以SOA的理念来实现,其通讯的基础单元就是“消息”,而不是类似于RPC(Remote procedure calls)的“操作”,所以这类web service也经常被称作面向消息的服务。SOA Web services是松耦合的,因为它的注意力是集中在WSDL提供的“契约”之上,而非其下的实现细节(WSDL本身是xml)回到问题本身,通讯基础单元是消息,消息中包含了方法返回值如hello等信息。
SOA 就是 IBM 弄出来骗钱的,IBM 每隔几年就会整出个新概念来骗钱。WebServices 就是向 endpoint(也就是服务端端点)发送 SOAP 内容的 HTTP POST 请求。
WebServices 只是实现 SOA 架构的技术之一。WebServices 指的并不是 SOA。
我第一句说的可能有点省,不过你看后面就知道了,是说实现了SOA的web service,webservices当然不能和soa挂等号Web services are a set of tools that can be used in a number of ways. The three most common styles of use are RPC, SOA and REST.
返回值得看具体返回值的类型, 一般是纯文本 ,当然也可以返回 xml json 等其他格式的数据其他的就不知道了。
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>