<commit_before>module QBWC
  module Controller
    def self.included(base)
      base.class_eval do
        include WashOut::SOAP
        skip_before_filter :_parse_soap_parameters, :_authenticate_wsse, :_map_soap_parameters, :only => :qwc
        before_filter :get_session, :except => [:qwc, :authenticate, :_generate_wsdl]
        after_filter :save_session, :except => [:qwc, :authenticate, :_generate_wsdl, :close_connection, :connection_error]

        soap_action 'serverVersion', :to => :server_version,
                    :return => {'tns:serverVersionResult' => :string},
                    :response_tag => 'tns:serverVersionResponse'

        soap_action 'clientVersion', :to => :client_version,
                    :args   => {:strVersion => :string},
                    :return => {'tns:clientVersionResult' => :string},
                    :response_tag => 'tns:clientVersionResponse'

        soap_action 'authenticate',
                    :args   => {:strUserName => :string, :strPassword => :string},
                    :return => {'tns:authenticateResult' => StringArray},
                    :response_tag => 'tns:authenticateResponse'

        soap_action 'sendRequestXML', :to => :send_request,
                    :args   => {:ticket => :string, :strHCPResponse => :string, :strCompanyFilename => :string, :qbXMLCountry => :string, :qbXMLMajorVers => :string, :qbXMLMinorVers => :string},
                    :return => {'tns:sendRequestXMLResult' => :string},
                    :response_tag => 'tns:sendRequestXMLResponse'

        soap_action 'receiveResponseXML', :to => :receive_response,
                    :args   => {:ticket => :string, :response => :string, :hresult => :string, :message => :string},
                    :return => {'tns:receiveResponseXMLResult' => :integer},
                    :response_tag => 'tns:receiveResponseXMLResponse'

        soap_action 'closeConnection', :to => :close_connection,
                    :args   => {:ticket => :string},
                    :return => {'tns:closeConnectionResult' => :string},
                    :response_tag => 'tns:closeConnectionResponse'

        soap_action 'connectionError', :to => :connection_error,
                    :args   => {:ticket => :string, :hresult => :string, :message => :string},
                    :return => {'tns:connectionErrorResult' => :string},
                    :response_tag => 'tns:connectionErrorResponse'

        soap_action 'getLastError', :to => :get_last_error,
                    :args   => {:ticket => :string},
                    :return => {'tns:getLastErrorResult' => :string},
                    :response_tag => 'tns:getLastErrorResponse'
      end
    end

    def qwc
      qwc = <<QWC
<QBWCXML>
   <AppName>#{Rails.application.class.parent_name} #{Rails.env} #{@app_name_suffix}</AppName>
   <AppID></AppID>
   <AppURL>#{url_for(:controller => self.controller_path, :action => 'action', :protocol => 'https://')}</AppURL>
   <AppDescription>Quickbooks integration</AppDescription>
   <AppSupport>#{QBWC.support_site_url || root_url(:protocol => 'https://')}</AppSupport>
   <UserName>qbint</UserName>
   <UserName>#{@username || QBWC.username}</UserName>
   <OwnerID>#{QBWC.owner_id}</OwnerID>
   <FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID>
   <QBType>QBFS</QBType>
   <Style>Document</Style>
   <Scheduler>
      <RunEveryNMinutes>#{QBWC.minutes_to_run}</RunEveryNMinutes>
   </Scheduler>
</QBWCXML>
QWC
      send_data qwc, :filename => 'servpac.qwc', :content_type => 'application/x-qwc'
    end
<commit_msg>support to override qwc action to change app name and username<commit_after>module QBWC
  module Controller
    def self.included(base)
      base.class_eval do
        include WashOut::SOAP
        skip_before_filter :_parse_soap_parameters, :_authenticate_wsse, :_map_soap_parameters, :only => :qwc
        before_filter :get_session, :except => [:qwc, :authenticate, :_generate_wsdl]
        after_filter :save_session, :except => [:qwc, :authenticate, :_generate_wsdl, :close_connection, :connection_error]

        soap_action 'serverVersion', :to => :server_version,
                    :return => {'tns:serverVersionResult' => :string},
                    :response_tag => 'tns:serverVersionResponse'

        soap_action 'clientVersion', :to => :client_version,
                    :args   => {:strVersion => :string},
                    :return => {'tns:clientVersionResult' => :string},
                    :response_tag => 'tns:clientVersionResponse'

        soap_action 'authenticate',
                    :args   => {:strUserName => :string, :strPassword => :string},
                    :return => {'tns:authenticateResult' => StringArray},
                    :response_tag => 'tns:authenticateResponse'

        soap_action 'sendRequestXML', :to => :send_request,
                    :args   => {:ticket => :string, :strHCPResponse => :string, :strCompanyFilename => :string, :qbXMLCountry => :string, :qbXMLMajorVers => :string, :qbXMLMinorVers => :string},
                    :return => {'tns:sendRequestXMLResult' => :string},
                    :response_tag => 'tns:sendRequestXMLResponse'

        soap_action 'receiveResponseXML', :to => :receive_response,
                    :args   => {:ticket => :string, :response => :string, :hresult => :string, :message => :string},
                    :return => {'tns:receiveResponseXMLResult' => :integer},
                    :response_tag => 'tns:receiveResponseXMLResponse'

        soap_action 'closeConnection', :to => :close_connection,
                    :args   => {:ticket => :string},
                    :return => {'tns:closeConnectionResult' => :string},
                    :response_tag => 'tns:closeConnectionResponse'

        soap_action 'connectionError', :to => :connection_error,
                    :args   => {:ticket => :string, :hresult => :string, :message => :string},
                    :return => {'tns:connectionErrorResult' => :string},
                    :response_tag => 'tns:connectionErrorResponse'

        soap_action 'getLastError', :to => :get_last_error,
                    :args   => {:ticket => :string},
                    :return => {'tns:getLastErrorResult' => :string},
                    :response_tag => 'tns:getLastErrorResponse'
      end
    end

    def qwc
      qwc = <<QWC
<QBWCXML>
   <AppName>#{Rails.application.class.parent_name} #{Rails.env} #{@app_name_suffix}</AppName>
   <AppID></AppID>
   <AppURL>#{url_for(:controller => self.controller_path, :action => 'action', :protocol => 'https://')}</AppURL>
   <AppDescription>Quickbooks integration</AppDescription>
   <AppSupport>#{QBWC.support_site_url || root_url(:protocol => 'https://')}</AppSupport>
   <UserName>#{@username || QBWC.username}</UserName>
   <OwnerID>#{QBWC.owner_id}</OwnerID>
   <FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID>
   <QBType>QBFS</QBType>
   <Style>Document</Style>
   <Scheduler>
      <RunEveryNMinutes>#{QBWC.minutes_to_run}</RunEveryNMinutes>
   </Scheduler>
</QBWCXML>
QWC
      send_data qwc, :filename => 'servpac.qwc', :content_type => 'application/x-qwc'
    end

{'fraction_non_alphanumeric': 0.14878218510786362, 'fraction_numerical': 0.005288796102992345, 'mean_word_length': 2.754440961337513, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 187, 'https://': 4, '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': '5411408', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2122, 'n_words': 377}