Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soap action named 'load' conflicts with private 'load' method #48

Closed
kalebwalton opened this issue Mar 13, 2010 · 4 comments
Closed

Soap action named 'load' conflicts with private 'load' method #48

kalebwalton opened this issue Mar 13, 2010 · 4 comments

Comments

@kalebwalton
Copy link

I wanted to encapsulate some common logic into a helper method and use the 'send' method to actually make the call to the Savon client (as below). It works for a soap action called 'search' but it does not work for one called 'load'. It turns out 'load' is a private method and 'send' is attempting to call it.

def soapcall(client, method_name, arg)
  response = client.send method_name, nil do |soap|
    soap.namespaces['xmlns:ns1'] = "http://services.foo.com/v1"
    soap.body = {
      'arg0' => arg
    }
  end
  response.to_hash[(method_name.to_s+"_response").to_sym][:return]
end
@rubiii
Copy link
Contributor

rubiii commented Mar 13, 2010

load is a Kernel method: http://ruby-doc.org/core/classes/Kernel.html#M005940
Savon uses method_missing to process soap requests. what i could do to workaround this issue, is add a public method that simply calls method_missing.

@kalebwalton
Copy link
Author

That'd be fine, I don't mind passing in a soap action name to a method call rather than calling a method with the same name. It would be sweet if I could do:


response = client.call(:load) do |soap|
soap.namespaces['xmlns:ns1'] = "http://services.foo.com/v1"
soap.body = {
'arg0' => arg
}
end

OR

response = client.call(:load, {
:namespaces => { 'xmlns:ns1' => 'http://services.foo.com/v1'},
:body => { 'arg0' => arg}
});

@rubiii
Copy link
Contributor

rubiii commented Mar 13, 2010

@rubiii
Copy link
Contributor

rubiii commented Mar 21, 2010

released version 0.7.6 containg a fix for this problem. please update.

calamitas pushed a commit to calamitas/savon that referenced this issue Jun 7, 2011
Savon::Client#call is a workaround for dispatching calls to SOAP actions named after
existing methods. fix for issue savonrb#48.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants