Module: QuickbooksWebConnector::SoapWrapper

Defined in:
lib/quickbooks_web_connector/soap_wrapper.rb,
lib/quickbooks_web_connector/soap_wrapper/default.rb,
lib/quickbooks_web_connector/soap_wrapper/defaultServant.rb,
lib/quickbooks_web_connector/soap_wrapper/QBWebConnectorSvc.rb,
lib/quickbooks_web_connector/soap_wrapper/defaultMappingRegistry.rb

Defined Under Namespace

Modules: DefaultMappingRegistry Classes: Authenticate, AuthenticateResponse, ClientVersion, ClientVersionResponse, CloseConnection, CloseConnectionResponse, ConnectionError, ConnectionErrorResponse, GetLastError, GetLastErrorResponse, QBWebConnectorSvcSoap, ReceiveResponseXML, ReceiveResponseXMLResponse, SendRequestXML, SendRequestXMLResponse, ServerVersion, ServerVersionResponse

Class Method Summary collapse

Class Method Details

.route(request) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/quickbooks_web_connector/soap_wrapper.rb', line 4

def self.route(request)
  @router = ::SOAP::RPC::Router.new('QBWebConnectorSvcSoap')
  @router.mapping_registry = DefaultMappingRegistry::EncodedRegistry
  @router.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry

  servant = QBWebConnectorSvcSoap.new
  QBWebConnectorSvcSoap::Methods.each do |definitions|
    opt = definitions.last
    if opt[:request_style] == :document
      @router.add_document_operation(servant, *definitions)
    else
      @router.add_rpc_operation(servant, *definitions)
    end
  end

  @connection_data = ::SOAP::StreamHandler::ConnectionData.new
  @connection_data.receive_string = request.raw_post
  @connection_data.receive_contenttype = request.content_type
  @connection_data.soapaction = nil

  @router.external_ces = nil
  response_data = @router.route(@connection_data)
  response_data.send_string
end