<commit_before>h1. Savon

p. Savon can be installed as a gem via:

bc. $ gem install savon

h3. Dependencies

bc. builder >= 2.1.2
crack >= 0.1.4

h2. Warning

p. To use a heavy metal library like this, you have to be familiar with SOAP, WSDL and tools like soapUI.

h2. First step

p. Instantiate a new instance of Savon::Client, passing in the WSDL of your service.

bc. proxy = Savon::Client.new "http://example.com/UserService?wsdl"

h3. The WSDL

p. You can find out about the SOAP actions available on the webservice by using the WSDL object.

bc. proxy.wsdl.soap_actions
=> [:get_all_users, :get_user_by_id, :user_magic]

p. Find out more about the "WSDL":http://wiki.github.com/rubiii/savon/wsdl object.

h3. Calling a SOAP action

p. Now, assuming your service applies to the default "Options":http://wiki.github.com/rubiii/savon/options, you can just call any available SOAP action.

bc. response = proxy.get_all_users

p. Savon lets you call SOAP actions using snake_case, because even though they will propably be written in lowerCamelCase or CamelCase, it just feels much more natural.

h3. Parameters

p. Specifying parameters for the SOAP service, can be done by simply passing a Hash to the SOAP action.

bc. response = proxy.get_user_by_id :id => 666

p. Learn more about [[Parameters]].

h3. The response

p. By default, the SOAP response is translated into a Hash. Take a look at the "Options":http://wiki.github.com/rubiii/savon/options for more information.

bc. proxy.get_user_by_id :id => 666
=> { :user_response => { :id => "666", :username => "gorilla" } }

h3. HTTP errors and SOAP faults

p. Savon raises a Savon::SOAPFault in case of a SOAP fault and a Savon::HTTPError in case of an HTTP error. More information about "Errors":http://wiki.github.com/rubiii/savon/errors.

h3. Logging

p. By default Savon logs each request and response to STDOUT. Specifying your own logger is as easy as it gets:

bc. Savon::Request.logger = RAILS_DEFAULT_LOGGER

Read more about "Logging":http://wiki.github.com/rubiii/savon/logging.<commit_msg>rdoc and wiki<commit_after>h1. Savon

p. Savon can be installed as a gem via:

bc. $ gem install savon

h3. Dependencies

bc. builder >= 2.1.2
crack >= 0.1.4

h2. Warning

p. To use a heavy metal library like this, you have to be familiar with SOAP, WSDL and tools like soapUI.

h2. First step

p. Instantiate a new instance of Savon::Client, passing in the WSDL of your service.

bc. proxy = Savon::Client.new "http://example.com/UserService?wsdl"

h3. The WSDL

p. You can find out about the SOAP actions available on the webservice by using the WSDL object.

bc. proxy.wsdl.soap_actions
=> [:get_all_users, :get_user_by_id, :user_magic]

p. Find out more about the "WSDL":http://wiki.github.com/rubiii/savon/wsdl object.

h3. Calling a SOAP action

p. Now, assuming your service applies to the default "Options":http://wiki.github.com/rubiii/savon/options, you can just call any available SOAP action.

bc. response = proxy.get_all_users

p. Savon lets you call SOAP actions using snake_case, because even though they will propably be written in lowerCamelCase or CamelCase, it just feels much more natural.

h3. Parameters

p. Specifying parameters for the SOAP service, can be done by simply passing a Hash to the SOAP action.

bc. response = proxy.get_user_by_id :id => 666

p. Learn more about [[Parameters]].

h3. The response

p. By default, the SOAP response is translated into a Hash. Take a look at the "Options":http://wiki.github.com/rubiii/savon/options for more information.

bc. proxy.get_user_by_id :id => 666
=> { :user_response => { :id => "666", :username => "gorilla" } }

h3. HTTP errors and SOAP faults

p. Savon raises a Savon::SOAPFault in case of a SOAP fault and a Savon::HTTPError in case of an HTTP error. More information about "Errors":http://wiki.github.com/rubiii/savon/errors.

h3. Logging

p. By default Savon logs each request and response to STDOUT. Specifying your own logger is as easy as it gets:

bc. Savon::Request.logger = RAILS_DEFAULT_LOGGER

Read more about "Logging":http://wiki.github.com/rubiii/savon/logging.

h3. RDoc and Wiki

p. Further information: "Wiki":http://wiki.github.com/rubiii/savon and "RDoc":http://rdoc.info/projects/rubiii/savon
{'fraction_non_alphanumeric': 0.09471210340775559, 'fraction_numerical': 0.011985898942420681, 'mean_word_length': 3.931633835457706, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6149054', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1398, 'n_words': 563}