使用SOAP4R解析WSDL文件
答
也许这不是你想要的答案,但我建议你切换到Savon例如,你的任务是这样的片段(这个例子从GitHub的萨翁页拍摄):
require "savon"
# create a client for your SOAP service
client = Savon::Client.new("http://service.example.com?wsdl")
client.wsdl.soap_actions
# => [:create_user, :get_user, :get_all_users]
# execute a SOAP request to call the "getUser" action
response = client.request(:get_user) do
soap.body = { :id => 1 }
end
response.body
# => { :get_user_response => { :first_name => "The", :last_name => "Hoff" } }
基本上我只需要来解释用户友好的方式将WSDL我需要列出操作,绑定,端点。你认为这个“Savon”能做到吗? –
你可以看看这些页面:http://rubydoc.info/gems/savon/0.7.9/Savon/WSDL和http://rubydoc.info /gems/wasabi/2.0.0/Wasabi/Document。通过Soap获得的所有方法。客户端实例在那里列出。你可以使用:soap_endpoint,:soap_actions,:operations,:type_definitions等,但不幸的是我不确定绑定:( – WarHog
,所以我试着再次使用SOAP4R,并用'require'wsdl/import“'和'@ wsdl = WSDL :: Importer.import(urlOfWsdl)''''''我已经设法打印所有需要的数据(非soap端点/端口的地址位置除外),但我也发现它不识别WSDL 2.0文件:( –