zend framework in web services

  • 3,202 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
3,202
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
28
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 王承石 blog:www.myued.com email:2012728@gmail.com 王承石 2012728@gmail.com www.myued.com
  • 2.
    • www.awflasher.com/blog/archives/1350
    • [email_address]
    王承石 2012728@gmail.com www.myued.com
  • 3. 我们对网络提供的服务有了什么样的需求变化 ? 对于网站架构发生了怎样的改变 ? SOAP or REST? 王承石 2012728@gmail.com www.myued.com
  • 4. rest
    • POST: 创建 insert
    • GET: 读取 select
    • PUT: 更新 updata
    • DELETE: 删除 delete
    • Rest 更像面向对象开发
    • 上下开发统一
    王承石 2012728@gmail.com www.myued.com
  • 5. app 开发流程 王承石 2012728@gmail.com www.myued.com
  • 6. 客户端 应用服务器 寄主服务器 Id+password+m1 m1+m2 REST*n templates 嵌入式 王承石 2012728@gmail.com www.myued.com
  • 7. 客户端 应用服务器 寄主服务器 Id+password auth_token 站外式 Auth_token Auth_token session_key 王承石 2012728@gmail.com www.myued.com
  • 8. 客户端 寄主服务器 桌面式 王承石 2012728@gmail.com www.myued.com
  • 9. 王承石 2012728@gmail.com www.myued.com auth_token+session_key 组合提高了安全性和开发问题 session_key+ 请求 =session 会话管理 重定向 嵌入式 不必做管理 不必管理 站外式 维护有效期 自主管理 桌面式 时刻生成 --
  • 10. 如何做整合
    • facebook 整合校内
    • 51 整合豆瓣 .
    王承石 2012728@gmail.com www.myued.com
  • 11. Zend framework in Web services 王承石 2012728@gmail.com www.myued.com
  • 12. 基础类
    • 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
    王承石 2012728@gmail.com www.myued.com
  • 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. Zend_Rest_Client
    • require_once 'Zend/Rest/Client.php';
    • $client = new Zend_Rest_Client('http://api.xiaonei.com/restserver.do');
    • $client->api_key ( $api_key );
    • $client->v ( $v );
    • $client->auth_token ( $_GET ['auth_token'] );
    • $client->method ( "xiaonei.auth.getSession" );
    • echo $client->get();
    王承石 2012728@gmail.com www.myued.com
  • 15. Zend_Rest_Client
    • require_once 'Zend/Rest/Client.php';
    • $client = new Zend_Rest_Client('http://api.xiaonei.com/restserver.do');
    • $client->api_key ( $api_key )->v ( $v )->auth_token ( $_GET ['auth_token'] )->method ( "xiaonei.auth.getSession" );
    • echo $client->get();
    • $client->method ( "xiaonei.users.getInfo" );
    • echo $client-> get ();
    王承石 2012728@gmail.com www.myued.com
  • 16. Differences in calling
    • echo $client-> get ();
    • echo $client-> post ();
    • echo $client-> put ();
    • echo $client-> delete ();
    • $result=$client->get();
    王承石 2012728@gmail.com www.myued.com
  • 17. Result is a object
    • echo $result->session_key();// 方法 XPath
    • foreach ($result-> friend as $v) {
    • echo $v->name;// 字段 php 数组
    • }
    王承石 2012728@gmail.com www.myued.com
  • 18. Response Status
    • if ($result->isSuccess()) {     echo $result;  }
    王承石 2012728@gmail.com www.myued.com
  • 19.
    • REST zend_rest(c,s)
    • Xmlrpc zend_xmlrpc(c,s)
    • Json JavaScript;zend_http+zend_json(c,”s”)
    • Rss,atom zend_feed(c,s)
    • Soap zend_soap( 孵化器 )
    王承石 2012728@gmail.com www.myued.com
  • 20. 灵活应用
    • 豆瓣
    • <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>
    王承石 2012728@gmail.com www.myued.com