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

How can I set headers when Extending a class? #792

Closed
Sigularusrex opened this issue Jan 11, 2017 · 4 comments
Closed

How can I set headers when Extending a class? #792

Sigularusrex opened this issue Jan 11, 2017 · 4 comments

Comments

@Sigularusrex
Copy link

How can I set headers when using extend Savon::Model in a class?

I can see how this is done in version1, but version2 has no documentation about it (that I have found)

Thanks

@Sigularusrex
Copy link
Author

Sigularusrex commented Jan 11, 2017

Ok, I've seen another question which happens to have sample code to answer this.
Using self.class.client in initialize

Example

 def initialize
     self.class.client wsdl: "http://api.example.com/v1/example?wsdl",
                       log: true,
                       log_level: :debug,
                       pretty_print_xml: true,
                       soap_header: {
                           "UserAuthentication" => {
                               Id: 11111,
                               Password: "!!!!!!"
                           }
                       }
   end

Additionally what confused me is I need to use soap_header: when the documentation for version 2 says to use headers:

@oranges13
Copy link

Be careful using self.class.client as it appears Savon does not properly sanitize attributes between requests. See #789 for more info.

@stale
Copy link

stale bot commented Feb 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 19, 2018
@stale
Copy link

stale bot commented Feb 26, 2018

This issue is now closed due to inactivity. If you believe this needs further action, please re-open to discuss.

@stale stale bot closed this as completed Feb 26, 2018
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