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

Calls fail if api methods have periods in them #1

Closed
aaronchi opened this issue Nov 30, 2009 · 5 comments
Closed

Calls fail if api methods have periods in them #1

aaronchi opened this issue Nov 30, 2009 · 5 comments

Comments

@aaronchi
Copy link

Hey, I was trying to test this out with the CampaignMonitor API. Unfortunately the api uses a format where the soap command contain periods (User.GetClients, Campaign.GetLists) etc.

Is there any way to get around this? Otherwise, very cool library.

@rubiii
Copy link
Contributor

rubiii commented Nov 30, 2009

thanks for filing an issue. i just published a fix for your problem (version 0.5.2).
soap actions like "User.GetApiKey" are now available as "user_get_api_key".

you can verify the mapping via:
proxy = Savon::Client.new "https://api.createsend.com/api/api.asmx?wsdl"
p proxy.wsdl.mapped_soap_actions

@rubiii
Copy link
Contributor

rubiii commented Nov 30, 2009

looking at the wsdl (and the mapping) again, it seems like the period-separated "namespaces" in front of the actual soap actions may not affect Savon. "User.GetApiKey" might be dispatched via:

proxy.get_api_key

but of course i would need to test this with a similar api to make sure it actually works. would love to get some feedback on this one.

@aaronchi
Copy link
Author

You can still dispatch the command but it errors trying to get the result because the soap action is sent as GetApiKey instead of User.GetApiKey. I think the namespaces would have to be appended in some manner to the call for this to work correctly. I will try it with 0.5.2

@rubiii
Copy link
Contributor

rubiii commented Nov 30, 2009

re-opened. investigating ...

@rubiii
Copy link
Contributor

rubiii commented Dec 6, 2009

i just release version 0.6.0 which should fix your problem. I had to make quite a few changes to the API in order to gain flexibility, so please read the Wiki before using the new version. You should be able to (for example) retrieve your API key via:

client = Savon::Client.new "https://api.createsend.com/api/api.asmx?wsdl"
response = client.user_get_api_key do |soap|
  soap.body = {
    "wsdl:SiteUrl" => "http://your-username.createsend.com",
    "wsdl:Username" => "your-username",
    "wsdl:Password" => "your-password"
  }
end

Please let me know if this works for you

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