PHP 的 Web Service Solution

昨天跟夢想家的 Emma 談到 Irose 前台改版成 PHP 的方案。


因為 Irose 採用 Mobocash 的 Web Service 來執行付款機制,但是 PHP 早期並沒有內建 SOAP ,必須透過一些 3rd Party 的程式來呼叫 Web Service。

另外好消息是 PHP5 已經有內建 SOAP extension,官方發佈消息如下:

Some of the key features of PHP 5 include:

  • The Zend Engine II with a new object model and dozens of new features.
  • XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library ( http://www.xmlsoft.org/ ).
  • A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa.
  • A brand new built-in SOAP extension for interoperability with Web Services.
  • A new MySQL extension named MySQLi for developers using MySQL 4.1 and later. This new extension includes an object-oriented interface in addition to a traditional interface; as well as support for many of MySQL’s new features, such as prepared statements.
  • SQLite has been bundled with PHP. For more information on SQLite, please visit their website .
  • Streams have been greatly improved, including the ability to access low-level socket operations on streams.

(以上資料來源: http://www.php.net/)

如果使用的是 PHP 4.3.0 以上,又不想用3rd Party的函式,可以參考這篇:
http://www.onlamp.com/pub/a/php/2003/10/30/amazon_rest.html

至於 PHP 早期的版本,比較有名的3rd Party 就屬 XML-RPC 跟 NuSOAP 了,XML-RPC 則是從 PHP 3 時代就能使用了,NuSOAP 目前到現在程式還是有在維護。

XML-RPC 官方網站
http://xmlrpc.usefulinc.com/php.html

XML-RPC SourceForge 網站
http://sourceforge.net/project/showfiles.php?group_id=34455

XML-RPC 使用範例:
http://php.weblogs.com/xml-rpc

NuSOAP 官方網站:
http://dietrich.ganx4.com/index.php?category=NuSOAP

NuSOAP 使用範例:
http://www.phpbuilder.com/columns/kramberger20031226.php3

XML-RPC 及 NuSOAP 使用範例:
http://www.xml.com/pub/a/ws/2004/03/24/phpws.html

在美國 Web Service 組織的網站中,可以找到 PHP 相關的資訊:
http://www.webservices.org/index.php/ws/content/search?SearchText=php

3 comments On PHP 的 Web Service Solution

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar