ไปเจอมาจาก Creating and Consuming Web Services With PHP
ขอตัดบางส่วนมาแปะใครสนใจก็ไปอ่านกันได้ (ตาม link นั้นแหล่ะ)
ส่วนใครอยากรู้จัก web server ลองอ่านที่ Web Services คืออะไร ... เขียนได้ดีจริงๆ
we will compare and contrast three methods of consuming and
producing web services: XML-RPC, SOAP and REST
XML-RPC
Remote Procedure Calls are used to establish and facilitate
transactions between two remote systems. Example of popular RPC
implementations include DCOM and CORBA. XML-RPC is an established
implementation of RPC that allows you to transport XML encoded data
between two servers using HTTP.
SOAP
SOAP is designed as an XML wrapper for web services requests and
responses. SOAP's strength lies in its use of namespaces, XML
Schema datatypes, and its flexibility with regard to transports.
The disadvantage of SOAP is the fact that the specs and
implementation is more complex, especially when you compare it to
the simple XML-RPC approach. SOAP is the bread and butter of
corporate web service developers. It has been deeply integrated
into Microsoft .NET and IBM WebSphere. Based on its popularity,
Google and Amazon.com have both created SOAP-based Web
services.
REST
(Representational State Transfer)
REST differs a great deal from SOAP and XML-RPC. First,
it's not a standard, whether formal or informal.
Second, there is no standardized toolkit or pre-built client and
server classes in PHP. The strength of REST is that you won't need
special extensions or tools to develop web services. The HTTP
protocol specifications contains everything you would need to
transmit and receive XML messages.
REST, which stands for "Representational State Transfer", is a
simpler approach than XML-RPC or SOAP, using standard HTTP methods
such as GET, POST and PUT to send and retrieve XML data. You can
then use tools like PHP DOM, SAX, or even XSL to do the parsing.
The downside is that everything has to be built by hand (though
REST toolkits and frameworks are starting to appear in some
languages). If you want to develop REST web services, you must
thoroughly understand XML and HTTP. Expect to have to write a
little more code yourself.
ไม่มีความเห็น