Я работаю с ruby 1.9.2, rails 3.2.1 и mysql, у меня есть приложение отдыха, но ссылки не работают, когда я иду на localhost: 3000 я получаю:
Errno::ENOENT in WsController#registro
No such file or directory - C:/Ruby192/PROYECTOS/loteriab/doc/loteria_registro.wsdl
Rails.root: C:/Ruby192/PROYECTOS/loteriab
Application Trace | Framework Trace | Full Trace
app/controllers/ws_controller.rb:43:in `get_result'
app/controllers/ws_controller.rb:33:in `registro'
вот код:
my view.html.erb
> <div id="menu"> <ul> <li> <%= link_to "login", root_path %><p
> >es el proceso mediante el cual se controla el acceso individual al webservice de loteria mediante la identificación del usuario
> utilizando credenciales provistas por el usuarioUn usuario</p> <%=
> link_to "registro", root_path %>
>
>
>
> <%= link_to " login ", "ws/registro" %>
> </li> </ul> </div>
мои маршруты:
root :to => 'ws#inicio'
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
match ':controller(/:action(/:id))(.:format)'
end
мой контроллер:
require 'savon'
class WsController < ApplicationController def inicio end
def login
data = {"Version" => "xx",
"CodEmpresa" => "xx",
"Rut" => "1579xxxxx-x",
"Clave" => "xxxx",
"SO" => "xx",
"Tipodispositivo" => "xx"}
response = get_result("loteria_autentificacion", data)
render :text => response
end
def registro
data = {"Version" => "01",
"CodEmpresa" => "01",
"CodAgente" => "01",
"Rut" => "1579xxxxx-x",
"email" => "xxxx@xxxxxxx.com",
"Clave" => "xxxx",
"SO" => "xx",
"Tipodispositivo" => "xx"}
response = get_result("loteria_registro", data)
render :xml => response end
def get_result(service, data)
client = Savon::Client.new do
wsdl.document = File.expand_path("#{Rails.root}/doc/#{service}.wsdl", __FILE__)
end
response = client.request :wsdl, service do
soap.body = data
end
return response.to_xml end end