<commit_before>h1. Savon

h4. Heavy metal Ruby SOAP client library

bc. $ gem install savon

p. Savon expects you to be familiar with SOAP, WSDL and tools like soapUI.

h3. Instantiate a client

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

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

p. More information: "Client":http://wiki.github.com/rubiii/savon/client

h3. Calling a SOAP action

p. Assuming your service applies to the "Defaults":http://wiki.github.com/rubiii/savon/defaults, you can now call any available SOAP action.

bc. response = client.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. The WSDL object

p. Savon::WSDL represents the WSDL of your service, including information like the namespace URI and available SOAP actions.

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

p. More information: "WSDL":http://wiki.github.com/rubiii/savon/wsdl

h3. The SOAP object

p. Savon::SOAP represents the SOAP request. Pass a block to your SOAP call and the SOAP object is passed to it as the first argument. The object allows setting the SOAP version, header, body and namespaces per request.

bc. response = client.get_user_by_id { |soap| soap.body = { :id => 666 } }

p. More information: "SOAP":http://wiki.github.com/rubiii/savon/soap

h3. The WSSE object

p. Savon::WSSE represents WSSE authentication. Pass a block to your SOAP call and the WSSE object is passed to it as the second argument. The object allows setting the WSSE username, password and whether to use digest authentication.

bc. response = client.get_user_by_id do |soap, wsse|
  wsse.username = "gorilla"
  wsse.password = "<PASSWORD>"
  soap.body = { :id => 666 }
end

p. More information: "WSSE":http://wiki.github.com/rubiii/savon/wsse

h3. The Response object

p. Savon::Response represents the HTTP and SOAP response. It contains and raises errors in case of an HTTP error or SOAP fault (unless disabled). Also you can get the response as XML (for parsing it with an XML library) or translated into a Hash.
More information: "Response":http://wiki.github.com/rubiii/savon/response

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: "Errors":http://wiki.github.com/rubiii/savon/errors

h3. Logging

p. Savon logs each request and response to STDOUT. But there are a couple of options to change the default behaviour.
More information: "Logging":http://wiki.github.com/rubiii/savon/logging

h3. Documentation

p. Wiki: "wiki.github.com/rubiii/savon":http://wiki.github.com/rubiii/savon<commit_msg>added todo<commit_after>h1. Savon

h4. Heavy metal Ruby SOAP client library

bc. $ gem install savon

p. Savon expects you to be familiar with SOAP, WSDL and tools like soapUI.

h3. Instantiate a client

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

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

p. More information: "Client":http://wiki.github.com/rubiii/savon/client

h3. Calling a SOAP action

p. Assuming your service applies to the "Defaults":http://wiki.github.com/rubiii/savon/defaults, you can now call any available SOAP action.

bc. response = client.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. The WSDL object

p. Savon::WSDL represents the WSDL of your service, including information like the namespace URI and available SOAP actions.

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

p. More information: "WSDL":http://wiki.github.com/rubiii/savon/wsdl

h3. The SOAP object

p. Savon::SOAP represents the SOAP request. Pass a block to your SOAP call and the SOAP object is passed to it as the first argument. The object allows setting the SOAP version, header, body and namespaces per request.

bc. response = client.get_user_by_id { |soap| soap.body = { :id => 666 } }

p. More information: "SOAP":http://wiki.github.com/rubiii/savon/soap

h3. The WSSE object

p. Savon::WSSE represents WSSE authentication. Pass a block to your SOAP call and the WSSE object is passed to it as the second argument. The object allows setting the WSSE username, password and whether to use digest authentication.

bc. response = client.get_user_by_id do |soap, wsse|
  wsse.username = "gorilla"
  wsse.password = "<PASSWORD>"
  soap.body = { :id => 666 }
end

p. More information: "WSSE":http://wiki.github.com/rubiii/savon/wsse

h3. The Response object

p. Savon::Response represents the HTTP and SOAP response. It contains and raises errors in case of an HTTP error or SOAP fault (unless disabled). Also you can get the response as XML (for parsing it with an XML library) or translated into a Hash.
More information: "Response":http://wiki.github.com/rubiii/savon/response

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: "Errors":http://wiki.github.com/rubiii/savon/errors

h3. Logging

p. Savon logs each request and response to STDOUT. But there are a couple of options to change the default behaviour.
More information: "Logging":http://wiki.github.com/rubiii/savon/logging

h3. TODO

p. I maintain a public todo list containing new features and patches at: http://rubiii.tadalist.com/lists/1459816/public

h3. Documentation

p. Wiki: "wiki.github.com/rubiii/savon":http://wiki.github.com/rubiii/savon
{'fraction_non_alphanumeric': 0.08894691035683203, 'fraction_numerical': 0.007310704960835509, 'mean_word_length': 4.2, 'pattern_counts': {'":': 18, '<': 5, '<?xml version=': 0, '>': 11, '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': '5124050', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1776, 'n_words': 726}