Your SlideShare is downloading. ×
0
王承石 blog:www.myued.com email:2012728@gmail.com 王承石  2012728@gmail.com www.myued.com
<ul><li>www.awflasher.com/blog/archives/1350 </li></ul><ul><li>[email_address] </li></ul>王承石  2012728@gmail.com www.myued....
我们对网络提供的服务有了什么样的需求变化 ?  对于网站架构发生了怎样的改变 ? SOAP or REST?  王承石  2012728@gmail.com www.myued.com
rest <ul><li>POST:  创建  insert </li></ul><ul><li>GET:  读取  select </li></ul><ul><li>PUT:  更新  updata </li></ul><ul><li>DEL...
app 开发流程 王承石  2012728@gmail.com www.myued.com
客户端 应用服务器 寄主服务器 Id+password+m1 m1+m2 REST*n templates 嵌入式 王承石  2012728@gmail.com www.myued.com
客户端 应用服务器 寄主服务器 Id+password auth_token 站外式 Auth_token Auth_token session_key 王承石  2012728@gmail.com www.myued.com
客户端 寄主服务器 桌面式 王承石  2012728@gmail.com www.myued.com
王承石  2012728@gmail.com www.myued.com auth_token+session_key 组合提高了安全性和开发问题 session_key+ 请求 =session 会话管理 重定向 嵌入式 不必做管理 不必管理...
如何做整合 <ul><li>facebook 整合校内 </li></ul><ul><li>51 整合豆瓣 . </li></ul>王承石  2012728@gmail.com www.myued.com
Zend framework in Web services 王承石  2012728@gmail.com www.myued.com
基础类 <ul><li>Zend_Acl Zend_Auth Zend_Cache Zend_Config Zend_Console_Getopt Zend_Controller Zend_Currency Zend_Date Zend_Db ...
services 王承石  2012728@gmail.com www.myued.com Zend_Feed Zend_Gdata Zend_Json Zend_Http Zend_Rest Zend_Infocard Zend_OpenId...
Zend_Rest_Client <ul><li>require_once 'Zend/Rest/Client.php'; </li></ul><ul><li>$client = new Zend_Rest_Client('http://api...
Zend_Rest_Client <ul><li>require_once 'Zend/Rest/Client.php'; </li></ul><ul><li>$client = new Zend_Rest_Client('http://api...
Differences in calling <ul><li>echo $client-> get (); </li></ul><ul><li>echo $client-> post ();  </li></ul><ul><li>echo $c...
Result is a object <ul><li>echo $result->session_key();// 方法 XPath </li></ul><ul><li>foreach ($result-> friend as $v) { </...
Response Status <ul><li>if ($result->isSuccess()) {     echo $result;  } </li></ul>王承石  2012728@gmail.com www.myued.com
<ul><li>REST zend_rest(c,s) </li></ul><ul><li>Xmlrpc zend_xmlrpc(c,s) </li></ul><ul><li>Json JavaScript;zend_http+zend_jso...
灵活应用 <ul><li>豆瓣 </li></ul><ul><li><db:attribute name=&quot;isbn10&quot;>7543639130</db:attribute> <db:attribute name=&quot...
Upcoming SlideShare
Loading in...5
×

zend framework in web services

3,255

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,255
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "zend framework in web services"

  1. 1. 王承石 blog:www.myued.com email:2012728@gmail.com 王承石 2012728@gmail.com www.myued.com
  2. 2. <ul><li>www.awflasher.com/blog/archives/1350 </li></ul><ul><li>[email_address] </li></ul>王承石 2012728@gmail.com www.myued.com
  3. 3. 我们对网络提供的服务有了什么样的需求变化 ? 对于网站架构发生了怎样的改变 ? SOAP or REST? 王承石 2012728@gmail.com www.myued.com
  4. 4. rest <ul><li>POST: 创建 insert </li></ul><ul><li>GET: 读取 select </li></ul><ul><li>PUT: 更新 updata </li></ul><ul><li>DELETE: 删除 delete </li></ul><ul><li>Rest 更像面向对象开发 </li></ul><ul><li>上下开发统一 </li></ul>王承石 2012728@gmail.com www.myued.com
  5. 5. app 开发流程 王承石 2012728@gmail.com www.myued.com
  6. 6. 客户端 应用服务器 寄主服务器 Id+password+m1 m1+m2 REST*n templates 嵌入式 王承石 2012728@gmail.com www.myued.com
  7. 7. 客户端 应用服务器 寄主服务器 Id+password auth_token 站外式 Auth_token Auth_token session_key 王承石 2012728@gmail.com www.myued.com
  8. 8. 客户端 寄主服务器 桌面式 王承石 2012728@gmail.com www.myued.com
  9. 9. 王承石 2012728@gmail.com www.myued.com auth_token+session_key 组合提高了安全性和开发问题 session_key+ 请求 =session 会话管理 重定向 嵌入式 不必做管理 不必管理 站外式 维护有效期 自主管理 桌面式 时刻生成 --
  10. 10. 如何做整合 <ul><li>facebook 整合校内 </li></ul><ul><li>51 整合豆瓣 . </li></ul>王承石 2012728@gmail.com www.myued.com
  11. 11. Zend framework in Web services 王承石 2012728@gmail.com www.myued.com
  12. 12. 基础类 <ul><li>Zend_Acl Zend_Auth Zend_Cache Zend_Config Zend_Console_Getopt Zend_Controller Zend_Currency Zend_Date Zend_Db Zend_Debug Zend_Exception Zend_Filter Zend_Filter_Input Zend_Form Zend_Layout Zend_Ldap Zend_Loader Zend_Locale Zend_Log Zend_Mail Zend_Measure Zend_Memory Zend_Mime Zend_Pdf Zend_Registry Zend_Search_Lucene Zend_Session Zend_Translate Zend_Validate Zend_Version Zend_View </li></ul>王承石 2012728@gmail.com www.myued.com
  13. 13. services 王承石 2012728@gmail.com www.myued.com Zend_Feed Zend_Gdata Zend_Json Zend_Http Zend_Rest Zend_Infocard Zend_OpenId Zend_Uri Zend_XmlRpc Zend_Server_Reflection Zend_Service_Akismet Zend_Service_Amazon Zend_Service_Audioscrobbler Zend_Service_Delicious Zend_Service_Flickr Zend_Service_Nirvanix Zend_Service_Simpy Zend_Service_SlideShare Zend_Service_StrikeIron Zend_Service_Technorati Zend_Service_Yahoo
  14. 14. Zend_Rest_Client <ul><li>require_once 'Zend/Rest/Client.php'; </li></ul><ul><li>$client = new Zend_Rest_Client('http://api.xiaonei.com/restserver.do'); </li></ul><ul><li>$client->api_key ( $api_key ); </li></ul><ul><li>$client->v ( $v ); </li></ul><ul><li>$client->auth_token ( $_GET ['auth_token'] ); </li></ul><ul><li>$client->method ( &quot;xiaonei.auth.getSession&quot; ); </li></ul><ul><li>echo $client->get(); </li></ul>王承石 2012728@gmail.com www.myued.com
  15. 15. Zend_Rest_Client <ul><li>require_once 'Zend/Rest/Client.php'; </li></ul><ul><li>$client = new Zend_Rest_Client('http://api.xiaonei.com/restserver.do'); </li></ul><ul><li>$client->api_key ( $api_key )->v ( $v )->auth_token ( $_GET ['auth_token'] )->method ( &quot;xiaonei.auth.getSession&quot; ); </li></ul><ul><li>echo $client->get(); </li></ul><ul><li>… </li></ul><ul><li>$client->method ( &quot;xiaonei.users.getInfo&quot; ); </li></ul><ul><li>echo $client-> get (); </li></ul>王承石 2012728@gmail.com www.myued.com
  16. 16. Differences in calling <ul><li>echo $client-> get (); </li></ul><ul><li>echo $client-> post (); </li></ul><ul><li>echo $client-> put (); </li></ul><ul><li>echo $client-> delete (); </li></ul><ul><li>$result=$client->get(); </li></ul>王承石 2012728@gmail.com www.myued.com
  17. 17. Result is a object <ul><li>echo $result->session_key();// 方法 XPath </li></ul><ul><li>foreach ($result-> friend as $v) { </li></ul><ul><li>echo $v->name;// 字段 php 数组 </li></ul><ul><li>} </li></ul>王承石 2012728@gmail.com www.myued.com
  18. 18. Response Status <ul><li>if ($result->isSuccess()) {     echo $result;  } </li></ul>王承石 2012728@gmail.com www.myued.com
  19. 19. <ul><li>REST zend_rest(c,s) </li></ul><ul><li>Xmlrpc zend_xmlrpc(c,s) </li></ul><ul><li>Json JavaScript;zend_http+zend_json(c,”s”) </li></ul><ul><li>Rss,atom zend_feed(c,s) </li></ul><ul><li>Soap zend_soap( 孵化器 ) </li></ul>王承石 2012728@gmail.com www.myued.com
  20. 20. 灵活应用 <ul><li>豆瓣 </li></ul><ul><li><db:attribute name=&quot;isbn10&quot;>7543639130</db:attribute> <db:attribute name=&quot;isbn13&quot;>9787543639133</db:attribute> <db:attribute name=&quot;pages&quot;>193</db:attribute> <db:attribute name=&quot;tranlator&quot;> 张兴 </db:attribute> <db:attribute name=&quot;price&quot;>14</db:attribute> <db:attribute name=&quot;author&quot;> 片山恭一 </db:attribute> <db:attribute name=&quot;publisher&quot;> 青岛出版社 </db:attribute> </li></ul>王承石 2012728@gmail.com www.myued.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×