文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>rails 中 soap web service

rails 中 soap web service

时间:2010-11-18  来源:ydhydh

 

rails版本 2.2.2

 

1. gem sources -a http://gems.github.com/ 2. gem install datanoise-actionwebservice -v 2.2.2 3. 将下一行加在 config/environtment.rb  Rails::Initializer.run do |config| do end 中     config.gem 'datanoise-actionwebservice', :lib => 'actionwebservice', :version => '2.2.2' 4. ruby script/generate web_service hello 5. services\hello_api.rb class HelloApi < ActionWebService::API::Base  api_method :hello_message, :expects => [{:firstname=>:string}, {:lastname=>:string}], :returns => [:string] end 6.controller\hello_controller.rb class HelloController < ApplicationController   wsdl_service_name 'Hello'  #辅助方法  web_service_scaffold :invoke      def hello_message(firstname, lastname)    return "nihao #{firstname}, #{lastname}"   end end 7. 调用 localhost:3000/hello/wsdl localhost:3000/hello/invoke
相关阅读 更多 +
排行榜 更多 +
坦克冒险大师安卓版

坦克冒险大师安卓版

策略塔防 下载
自动防御

自动防御

策略塔防 下载
枪战大乱斗2

枪战大乱斗2

飞行射击 下载