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 ( ).
  • 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.


如果使用的是 PHP 4.3.0 以上,又不想用3rd Party的函式,可以參考這篇:

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

XML-RPC 官方網站

XML-RPC SourceForge 網站

XML-RPC 使用範例:

NuSOAP 官方網站:

NuSOAP 使用範例:

XML-RPC 及 NuSOAP 使用範例:

在美國 Web Service 組織的網站中,可以找到 PHP 相關的資訊:

3 comments On PHP 的 Web Service Solution

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar