savon

Savon: How to change header from being <env:Header> to <soap:Header> or something different

别来无恙 提交于 2019-12-07 04:44:08
问题 In Savon, is there a way to change <env:Header> to be <soap:Header> or anything different? I've tried in the request block putting an additional header tag like this: soap.header['soap:Header'] But that won't work. I've browsed Savon Docs and haven't found anywhere to change that tag, only by manually building the XML. 回答1: EDITED for Savon 1.0.0 The value can be set in the configure block where you can also set logging and other parameters. Simply put Savon.configure do |c| c.env_namespace =

cannot set SOAP header parameters on savon call

不羁的心 提交于 2019-12-06 02:57:45
问题 I'm using savon 2.2 for making SOAP calls. Initialize: client = Savon.client( wsdl: SOAP_WSDL, endpoint: SOAP_URL) I can make a SOAP call like this and it works fine: resp = client.call(:login, message: { username: SOAP_USER, password: SOAP_PASSWORD }) Now I need to make another call which requires setting some parameters in the SOAP header. From the documentation on savorb.com I found I should use the request method: response = client.request :get_user_info do soap.header = { :session_id =>

NTLM support for Savon

不想你离开。 提交于 2019-12-05 18:13:21
I'm using Savon to communicate with SharePoint using web services. Everything is working fine if SharePoint web application supports basic authentication, but if I change it to NTLM it fails. It fails at line newclient.http.auth.ntlm(username, password) and the error message is Install the httpi-ntlm gem for experimental NTLM support . FYI I have allready installed the specified gem and am using it. 来源: https://stackoverflow.com/questions/14050567/ntlm-support-for-savon

how to set savon default timeout value

*爱你&永不变心* 提交于 2019-12-05 02:08:10
I am using savon to make some api calls but its taking long time to respond because of that i am getting time out errors.so is there any way to change the default value of timeout. I am using savon 0.7.9 ruby 1.8.7 and rails -v 2.3.2. Savon uses the gem HTTPI as interface to the transport layer. Therefore you need to change the timeout for the http calls. here an example (Savon 1.x) jira = Savon::Client.new do wsdl.document = 'http://jira.my-domain.com/rpc/soap/jirasoapservice-v2?wsdl' end jira.http.read_timeout = 300 EDIT: the syntax has changed for Savon 2.x jira = Savon.client( wsdl: 'http:

connect: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

耗尽温柔 提交于 2019-12-04 18:07:38
问题 I'm having a terrible time getting SSL to verify a certificate. I'm completely ignorant on how certificates work so that's a major handicap to begin with. Here's the error I get when running the script: c:/Ruby191/lib/ruby/1.9.1/net/http.rb:611:in `connect': SSL_connect returned=1 e rrno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL ::SSL::SSLError) Here's the relevant code: client = Savon::Client.new order_svc request = client.create_empty_cart { |soap, http|

How to pass Array as parameter to SOAP in Ruby

纵饮孤独 提交于 2019-12-04 14:30:30
问题 Currently I'm using Savon to work with WebService in ruby. It works pretty well but I have difficulty to pass parameter for argument of SOAP array type. Following code doesn't work properly: ids = [0,1,2] client.do_get_items { |soap| soap.body = { 'item-list' => ids } I would appreciate if you can solve my problem or propose an alternative library for ruby&soap 回答1: I just stumbled on the same problem and the temporary workaround that worked for me is as follows: ids = [0,1,2] client.do_get

How to write SOAP Authentication header with Ruby Savon

点点圈 提交于 2019-12-04 12:53:36
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://api.five9.com/wsadmin/AdminWebService HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml

Parsing SOAP response using SAVON response.to_hash conversion method

泄露秘密 提交于 2019-12-04 11:20:37
I am having trouble parsing a SOAP response. Here is my code: require 'rubygems' require 'savon' client = Savon::Client.new "http://1.2.3.4/xyz/abcd/fsds.wsdl" res = client.query_unpaid_assesments do |soap,wsse| soap.namespaces["xmlns:SOAP-ENV"] = "http://schemas.xmlsoap.org/soap/envelope/" soap.namespaces["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance" soap.namespaces["xmlns:xsd"] = "http://www.w3.org/2001/XMLSchema" wsse.username="xyz" wsse.password="123" soap.body = {:orderNumber => 111222333 } end response = Savon::Response#to_hash hres = response.to_hash all_data = hres[

cannot set SOAP header parameters on savon call

吃可爱长大的小学妹 提交于 2019-12-04 08:32:49
I'm using savon 2.2 for making SOAP calls. Initialize: client = Savon.client( wsdl: SOAP_WSDL, endpoint: SOAP_URL) I can make a SOAP call like this and it works fine: resp = client.call(:login, message: { username: SOAP_USER, password: SOAP_PASSWORD }) Now I need to make another call which requires setting some parameters in the SOAP header. From the documentation on savorb.com I found I should use the request method: response = client.request :get_user_info do soap.header = { :session_id => sid } end But I'm getting an error saying that the request method does not exist: undefined method

Does SAVON support client side certificates authentication

只谈情不闲聊 提交于 2019-12-04 05:02:30
I'm evaluating savon for consuming webservices... but I dont find any information if I can use a SSL client side certificate to authenticate against the server that provides the SOAP webservices. I read the documentation but didn't find anything about it. Does anyone know if SAVON supports client side certificate authentication? Regards Fak rubiii the latest stable version of Savon (2.2.0 at this moment) supports SSL client certificates via global options. Please refer to the SSL section in the documentation . Here is some example code, assuming httpclient is used with httpi: savonConfig = {