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

Savon WSDL client for WOS SOAP API #222

Merged
merged 2 commits into from
Sep 29, 2017
Merged

Savon WSDL client for WOS SOAP API #222

merged 2 commits into from
Sep 29, 2017

Conversation

dazza-codes
Copy link
Contributor

@dazza-codes dazza-codes commented Sep 27, 2017

Fix #186

This explores using the ruby savon gem for SOAP.

  • it can authenticate to the new SOAP API for Web of Science
  • it initializes a search SOAP client

Use in rails c

[2] pry(main)> wos = WosClient.new(Settings.WOS.AUTH_CODE);
I, [2017-09-27T08:58:32.938193 #12354]  INFO -- : SOAP request: http://search.webofknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate
I, [2017-09-27T08:58:32.938383 #12354]  INFO -- : Authorization: Basic {{SECRET_SNIPPED}}, SOAPAction: , Content-Type: text/xml;charset=UTF-8, Content-Length: 397
I, [2017-09-27T08:58:33.238701 #12354]  INFO -- : SOAP response (status 200)
[3] pry(main)> wos.session_id
=> "1F28d8jTIRdrY9Oi4aF"
[4] pry(main)> wos.auth.class
=> Savon::Client
[5] pry(main)> wos.search.class
=> Savon::Client
[6] pry(main)> wos.search.operations
=> [:cited_references_retrieve, :related_records, :cited_references, :retrieve, :search, :citing_articles, :retrieve_by_id]
[7] pry(main)> wos.auth.operations
=> [:authenticate, :close_session]

I use this with a config/settings.local.yml file that contains the actual auth-token.

TODO:

Related issues:

@dazza-codes dazza-codes changed the title [WIP] Savon wsdl client [WIP] Savon WSDL client Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@dazza-codes dazza-codes force-pushed the savon-wsdl-client branch 2 times, most recently from f575ff6 to adc47da Compare September 27, 2017 17:34
@dazza-codes dazza-codes changed the title [WIP] Savon WSDL client [WIP] Savon WSDL client for WOS SOAP API Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@dazza-codes dazza-codes force-pushed the savon-wsdl-client branch 3 times, most recently from abc9bed to 7c543a4 Compare September 27, 2017 21:35
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@sul-dlss sul-dlss deleted a comment from coveralls Sep 27, 2017
@dazza-codes dazza-codes force-pushed the savon-wsdl-client branch 2 times, most recently from e1afc05 to 81b9e53 Compare September 27, 2017 23:01
@dazza-codes dazza-codes mentioned this pull request Sep 27, 2017
4 tasks
@dazza-codes dazza-codes force-pushed the savon-wsdl-client branch 2 times, most recently from 8d2fe03 to 172b860 Compare September 28, 2017 00:38
@dazza-codes dazza-codes changed the title [WIP] Savon WSDL client for WOS SOAP API Savon WSDL client for WOS SOAP API Sep 29, 2017
@dazza-codes
Copy link
Contributor Author

dazza-codes commented Sep 29, 2017

My only thoughts on enhancing this client are around how to close the session automatically when the object is detroyed (so it doesn’t leave open sessions dangling). The problem can be pushed up to consumers to explicitly call the close_session. There are some patterns for auto-closing stuff that generally work with class methods, like File.open can take a block and then do stuff after the yield is done to clean up file handlers. I’ll put this commentary in a tech-debt issue, it could be addressed later.

@@ -0,0 +1,67 @@
require 'spec_helper'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this line because it is done in the .rspec file.

@atz atz merged commit 1cd3796 into master Sep 29, 2017
@atz atz removed the in progress label Sep 29, 2017
@atz atz deleted the savon-wsdl-client branch September 29, 2017 23:28
@dazza-codes dazza-codes self-assigned this Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create new client for WoS
2 participants