Я пытаюсь создать клиент веб-службы в Ruby.
Когда я пытаюсь вызвать следующий скрипт ruby soap4r для генерации кода клиента веб-службы:
wsdl2ruby.rb --wsdl *[web_service_url]* --type client
Я получаюследующая ошибка:
игнорируется attr: {http://www.w3.org/2006/05/addressing/wsdl}Action I, [2011-06-09T17: 16: 01.012268 # 10104] INFO - приложение: создание определения класса.I, [2011-06-09T17: 16: 01.012268 # 10104] INFO - приложение: создает файл 'SessionServic e.rb'.F, [2011-06-09T17: 16: 01.014268 # 10104] FATAL - приложение: обнаружено исключение.Прекратить пинг ... неопределенный метод collect' for #<String:0x32260c8> (NoMethodError)
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb:2
39:in
trim_eol 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb: 2 27: in format'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/commentdef.rb:2
7:in
dump_comment 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/classdef.rb: 51: в dump'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:118:in
блок в dump_complextype' C: /Ruby192 / lib / ruby / gems / 1.9.1 / gems / soap4r-1.5.8 / lib / wsdl / soap / classDefCreator.rb: 116: в collect'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:116:in
dump_complextype 'C: /Ruby192/lib/ruby/gems/1.9.1 / gems / soap4r-1.5.8 / lib / wsdl / soap / classDefCreator.rb: 60: в dump'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:77:i
n
блоке в create_classdef 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8 / lib / wsdl / soap / wsdl2ruby.rb: 171: в block in write_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:
in
open 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170: в write_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:76:i
n
create_classdef 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb: 62: в create_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:i
n
запустите 'C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/bin/wsdl2ruby.rb: 46: в run'
C:/Ruby192/lib/ruby/1.9.1/logger.rb:691:in
запустите' C: / Ruby192 / lib / ruby /gems / 1.9.1 / gems / soap4r-1.5.8 / bin / wsdl2ruby.rb: 137: в <top (
required)>'
C:/Ruby192/bin/wsdl2ruby.rb:19:in
load 'C: /Ruby192/bin/wsdl2ruby.rb: 19: in `'I, [2011-06-09T17: 16: 01.016268 # 10104] INFO - приложение: конец приложения.(состояние: -1)
Когда я пытаюсь вызвать следующий код для динамической генерации клиента веб-службы:
require 'soap/wsdlDriver'
WSDL_URL = "http://*[web_service_url]*"
factory = SOAP::WSDLDriverFactory.new(WSDL_URL)
driver = factory.create_rpc_driver
Я получаю следующую ошибку:
C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 748: в initialize': The requested service
provider could not be loaded or
initialized. - socket(2)
(http://*web_service_url*) (Errno::E10106)
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in
new 'из C: / Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in create_socket' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:705:in
block in connect 'из C: /Ruby192/lib/ruby/1.9.1/timeout.rb:57:in timeout' from
C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in
timeout 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 704: в connect' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:568:in
query 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 158: в query' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:1057:in
do_get_block' из C: / Ruby192 / lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:866:in block in do_request' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:953:in
protect_keep_alive_disconnected 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1 / lib / httpclient.rb: 865: в do_request' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:938:in
follow_redirect 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb: 577: в get_content' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:73:in
fetch 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb: 36: в import' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in
import 'из C: / Ruby192 / lib /ruby / gems / 1.9.1 / gems / soap4r-1.5.8 / lib / soap / wsdlDriver.rb: 146: в import' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:32:in
initialize 'из C: /DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6: в new' from
C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in
'
Когда я пытаюсь вызвать тот же код выше, но с другим URL-адресом (рабочий URL-адрес вместо URL-адреса тестовой среды), я получаю другую ошибку:
C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 748: в initialize': getaddrinfo: A non-recoverable error occurred during a database lookup. (https://[prod_url]:443) (SocketError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in
new 'из C: / Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in create_socket'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:705:in
block in connect 'из C: /Ruby192/lib/ruby/1.9.1/timeout.rb:57:in timeout'
from C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in
timeout 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 704: в connect'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:568:in
query 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb: 158: в query'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:1057:in
do_get_block' из C: / Ruby192 / lib/ рубин / GEms / 1.9.1 / gems / httpclient-2.2.1 / lib / httpclient.rb: 866: в block in do_request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:953:in
protect_keep_alive_disconnected 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1 / lib / httpclient.rb: 865: в do_request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:938:in
follow_redirect 'из C: /Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb: 577: в get_content'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:73:in
fetch '
из C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb: 36: в import'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in
import '
из C: /Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb: 146: в import'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:32:in
initialize '
из C: /DevProjects/application-development-environment/UwsSampleRuby/blah.rb: 6: в new'
from C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in
'
Почему я получаю эти ошибки и как их обойти? Я знаю, что веб-сервисы работают и работают, так как я могу нормально создавать клиентов веб-сервисов на C # .Net.