<commit_before># @author <NAME> <<EMAIL>>

module SavonHelper

  class MappingObject
    @@mappings = Hash.new()

    # @!group Request Helper

    # Send a Request to the SOAP API for method +method_name+ with the data in +soap_body+ and unwrap the response
    def send_soap(method, message = {})
      retryable(:tries => 5, :on => Errno::ECONNRESET) do
        logger.debug { "#{self.class}\##{__method__}(#{method.inspect}, #{message.inspect})" }
        response = @client.call method, :message => message
        return response.to_hash[(method.to_s+"_response").to_sym][(method.to_s+"_return").to_sym]
      end
    end

    # Helper Method deserializing the SOAP response into an object
    def request_object(method_name, object_class, soap_body={})
      object_class.from_savon_data(self, send_soap(method_name, soap_body))
    end

    # Helper Method deserializing the SOAP response into an object
    def request_array(method_name, object_class, collection_name = nil, soap_body={})
      data = send_soap(method_name, soap_body)<commit_msg>Renamed SOAP Body, removed self reference.<commit_after># @author <NAME> <<EMAIL>>

module SavonHelper

  class MappingObject
    @@mappings = Hash.new()

    # @!group Request Helper

    # Send a Request to the SOAP API for method +method_name+ with the data in +soap_body+ and unwrap the response
    def send_soap(method, message = {})
      retryable(:tries => 5, :on => Errno::ECONNRESET) do
        logger.debug { "#{self.class}\##{__method__}(#{method.inspect}, #{message.inspect})" }
        response = @client.call method, :message => message
        return response.to_hash[(method.to_s+"_response").to_sym][(method.to_s+"_return").to_sym]
      end
    end

    # Helper Method deserializing the SOAP response into an object
    def request_object(method_name, object_class, arguments={})
      object_class.from_savon_data(send_soap(method_name, arguments))
    end

    # Helper Method deserializing the SOAP response into an object
    def request_array(method_name, object_class, collection_name = nil, arguments={})
      data = send_soap(method_name, arguments)
{'fraction_non_alphanumeric': 0.11475409836065574, 'fraction_numerical': 0.000936768149882904, 'mean_word_length': 4.014084507042254, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '6419159', 'n_tokens_mistral': 670, 'n_tokens_neox': 659, 'n_words': 177}