savon

Ruby & Savon SOAP client - Unable to find SOAP operation

廉价感情. 提交于 2020-01-03 00:22:09
问题 First time working with a SOAP client, so not sure what I'm doing wrong here. Here's the SOAP API I'm trying to use: http://services.carsolize.com/BookingServices/DynamicDataService.svc?wsdl irb(main):018:0> client = Savon.client(wsdl: "http://services.carsolize.com/BookingServices/DynamicDataService.svc?wsdl", convert_request_keys_to: :camelcase) No matter what I pass to call on client , it tells me: irb(main):022:0> client.call :service_request, :message => {} HTTPI GET request to services

Searching savon response as nokogiri document returns an empty array

女生的网名这么多〃 提交于 2019-12-25 03:19:25
问题 I try to parse savon's response as nokokiri document c = Savon.client(wsdl: 'http://test.fedresurs.ru/MessageService/WebService.svc?wsdl', digest_auth: ['demowebuser', 'Ax!761BN'], namespace: "http://tempuri.org/", namespace_identifier: :tem, log: true) r = c.call(:get_trade_messages, message: {'tem:startFrom' => DateTime.now-1}) r.doc.search("TradePlace") and it returns an empty array. What I'm doing wrong? May be I should deal somehow with namespaces? But, how?. Examples, that I found in

Savon is returning no result in Rails 4?

末鹿安然 提交于 2019-12-25 03:11:08
问题 I have asked this question in here Savon 2 returns nothing And got the answer. Thanks to +Steffen Roller Now most of my Soap API are sorted. With this one, I have tried everything still nothing I get. I thought it should work as the USZip worked. Apparently not :( Soap API: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:GetHistoryByID> <!--Optional:--> <tem:personId>789834133</tem:personId> <

Grab specific data from soap API Response using Ruby and Savon

我们两清 提交于 2019-12-24 21:37:03
问题 I am making a soap API call using the Savon Gem in a Rails App - See below: base_provider.rb: class Five9Providers::BaseProvider def initialize() @realm = Base64.strict_encode64("test@test.com:passwordtest") end def soap_client soap_client = Savon.client( wsdl: "https://api.five9.com/wsadmin/AdminWebService?wsdl&user=test@test.com", namespace: "http://service.admin.ws.five9.com/", headers: {"Authorization" => "Basic #{@realm}"}, env_namespace: :soapenv, namespace_identifier: :ser, logger:

How to get the list of inputs for a particular operation in savon gem

谁说胖子不能爱 提交于 2019-12-24 13:28:38
问题 Is there way to get the list of inputs(arguments) for a particular operation from a wsdl file in savon gem? https://github.com/savonrb/savon 回答1: You can do this with the latest version of Savon (version 3): client = Savon.new('your_wsdl_url') op = client.operation('yourServiceName', 'yourPortName', :yourOperationName) op.example_body See the version 3 documentation for more information: http://savonrb.com/version3.html. This page also provides instructions for installing this version. 来源:

Savon returning XML as string, not hash

自古美人都是妖i 提交于 2019-12-24 08:20:45
问题 I am trying to parse a SOAP response using Savon. The response is XML but is being returned as one long string. If I use #to_hash the entire XML object is still a string, now stored in hash[:response][:return] which means it is still a huge unusable mess. My code looks like response = soapClient.request(:get_sites_user_can_access) do soap.body = { :sessionid => session[:login_response][:login_return], :eid => user } end rep = response.to_hash pp rep[:get_sites_user_can_access_response][:get

Savon: Array of XML tags

不问归期 提交于 2019-12-24 04:54:10
问题 I'm using Savon for SOAP requests and in some place of the SOAP request XML, I need to generate this piece of code: <content> <item a="1" b="0"/> <item a="2" b="0"/> <item a="3" b="0"/> </content> What's the best way to do this? 回答1: I have found the solution. soap.body = { #... other tags "content" => { "item" => ["", "", ""], :attributes! => { "item" => { "a" => ["1", "2", "3"], "b" => ["0", "0", "0"] } } } #... other tags } 回答2: Savon v0.9.7 comes with improved support for Builder and I

How to write SOAP Authentication header with Ruby Savon

六月ゝ 毕业季﹏ 提交于 2019-12-21 20:30:07
问题 I am making calls to a SOAP based API for the first time, and I have the following info from the documentation: In your client, construct your authorization header as follows: 1 Concatenate the user name and password, for example: ExampleUsername:ExamplePassword 2 Encode the string in base 64, for example: RXhhbXBsZVVzZXJOYW1lOkV4YW1wbGVQYXNzd29yZA== 3 In your code, enter the Authorization header with the value Basic . Example Web Services header with encoded user name and password POST https

Replicating XML Request with Savon/Ruby

送分小仙女□ 提交于 2019-12-20 04:36:55
问题 I am trying to avoid using Nokogiri/Builder to build my XML and would like to instead use the Savon gem with Ruby 2.0.0. I have the following request I need to replicate: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetList xmlns="http://tempuri.org/"> <listRequest xmlns:a="http://schemas.datacontract.org/2004/07/Services.List" i:type="b:NpsListRequest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:b="http://schemas.datacontract.org/2004/07/Services

Rails - Savon set multiple namespaces

前提是你 提交于 2019-12-19 17:33:22
问题 I'm using savon version 2 (with Ruby on Rails )to invoke a webservice and i need to inject some additional namespaces to my Envelope. Something like: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:newNamespace1="http://someURL.pt/Test1" xmlns:newNamespace2="http://someURL.pt/Test2" xmlns:newNamespace3="http://someURL.pt/Test3" My current code is: client = Savon.client do wsdl "https://someValidURL