關於codeigniter的xmlrpc的類在進行資料交換時的類型問題

來源:互聯網
上載者:User

簡介:這是關於codeigniter的xmlrpc的類在進行資料交換時的類型問題的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=339655' scrolling='no'>

在使用codeigniter的xmlrpc類進行用戶端/服務端請求應答的時候,用戶端需要發送請求參數給服務端,服務端在接受到參數之後進行參數分析,分拆參數之後分配給正確的方法進行處理,處理之後反饋一個response給用戶端。

用戶端發送的請求類似這樣

$request = array('parameters00','parameters01');

在用戶端的請求你可以制定參數的資料類型,你可以將每個參數單獨的放進一個數組,在數組的第二個位置制定參數的資料類型,類似這樣

$request = array(                   array('parameters00','string'),                   array('parameters01','boolean'),                   array('parameters02','struct'),                   array('parameters03','int'),);

服務端的返回response有一點硬性的要求,必須要格式化數組,並且在response數組中必須只有一個主數組,類似這樣:

$response = array(                       array(parameters00 => array('para00','string'),                       parameters01 => array('para01','struct'),                       parameters02 => array('para02','boolean'),                       ),'struct');

如果你要使用關聯陣列需要注意一下,要注意關聯陣列的類型制定問題,類似這樣:

$request = array(                   array(                         'parameters00' => array(array('paraoo' => 'value'),'struct'),                         'parameters01' => array('para01','string'),                     ),'struct');

本文作者 愛幫競人才網創始人 高學平

愛J2EE關注Java邁克爾傑克遜視頻站JSON線上工具

http://biancheng.dnbcw.info/php/339655.html pageNo:7

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.