<commit_before>module XRoad
  class ActiveXRoad
    def self.create_header(producer, user_id, service)
      id = UUIDTools::UUID.random_create.to_s
      id.delete! '-'
      {
        "xtee:id" => id,
        "xtee:nimi" => service,
        "xtee:asutus" => XRoad.configuration.consumer,
        "xtee:andmekogu" => producer,
        "xtee:isikukood" => user_id
      }
    end

    def self.request(action, namespace, header, body)
      client = create_client(namespace)
      response = client.call(
        action,
        soap_header: header,
        message: body
      )
      response.body
    end

    def self.create_client(ns)
      config = XRoad.configuration
      Savon.client do
        endpoint config.host
        ssl_cert_file config.client_cert
        ssl_cert_key_file config.client_key
        pretty_print_xml true
        ssl_verify_mode config.ssl_verify
        log true
        log_level config.log_level
        namespace_identifier "prdcr"
        namespace ns
        namespaces(
          "xmlns:xtee" => "http://x-tee.riik.ee/xsd/xtee.xsd",
          "xmlns:prdcr" => ns
        )
      end
    end
  end
end<commit_msg>fix ree incompatible code<commit_after>module XRoad
  class ActiveXRoad
    def self.create_header(producer, user_id, service)
      id = UUIDTools::UUID.random_create.to_s
      id.delete! '-'
      {
        "xtee:id" => id,
        "xtee:nimi" => service,
        "xtee:asutus" => XRoad.configuration.consumer,
        "xtee:andmekogu" => producer,
        "xtee:isikukood" => user_id
      }
    end

    def self.request(action, namespace, header, body)
      client = create_client(namespace)
      response = client.call(
        action,
        :soap_header => header,
        :message => body
      )
      response.body
    end

    def self.create_client(ns)
      config = XRoad.configuration
      Savon.client do
        endpoint config.host
        ssl_cert_file config.client_cert
        ssl_cert_key_file config.client_key
        pretty_print_xml true
        ssl_verify_mode config.ssl_verify
        log true
        log_level config.log_level
        namespace_identifier "prdcr"
        namespace ns
        namespaces(
          "xmlns:xtee" => "http://x-tee.riik.ee/xsd/xtee.xsd",
          "xmlns:prdcr" => ns
        )
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09278350515463918, 'fraction_numerical': 0.0, 'mean_word_length': 2.0404699738903394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7431741', 'n_tokens_mistral': 764, 'n_tokens_neox': 742, 'n_words': 144}