Sha256: adce06a853937f40c0c3c2c9fc5d2fc1e4a33b65b4a5e5dacd8561914fb7a68f
Contents?: true
Size: 1.32 KB
Versions: 13
Compression:
Stored size: 1.32 KB
Contents
module Effective class QbSyncController < ApplicationController skip_authorization_check if defined?(CanCan) skip_before_action :verify_authenticity_token def api # respond successfully to a GET which some versions of the Web Connector send to verify the url (render(body: '') and return) if request.get? # Examine raw post and determine which API call to process doc = Nokogiri::XML(request.raw_post) @qbwcSupervisor = QbwcSupervisor.new api_verb = (doc.at_xpath('//soap:Body').children.first.node_name rescue '') case api_verb when 'serverVersion' @version = '1.0' when 'clientVersion' @version = nil when 'authenticate' @token, @message = @qbwcSupervisor.authenticate(doc) when 'sendRequestXML' @message = @qbwcSupervisor.sendRequestXML(doc) when 'receiveResponseXML' @message = @qbwcSupervisor.receiveResponseXML(doc) when 'getLastError' @message = @qbwcSupervisor.getLastError(doc) when 'connectionError' @message = @qbwcSupervisor.connectionError(doc) when 'closeConnection' @message = @qbwcSupervisor.closeConnection(doc) else '' end render(template: "/effective/qb_sync/#{api_verb}.erb", layout: false, content_type: 'text/xml') end end end
Version data entries
13 entries across 13 versions & 1 rubygems