Class: Virtuozzo::SOAP::HeaderHandler

Inherits:
SOAP::Header::SimpleHandler
  • Object
show all
Defined in:
lib/virtuozzo/soap.rb

Overview

HeaderHandler

Class designed to handle parsing the header region of a SOAP envelope for the Virtuozzo API.

Constant Summary collapse

NAMESPACE =
'http://www.swsoft.com/webservices/vzl/4.0.0/soap_protocol'

Instance Method Summary collapse

Constructor Details

#initialize(session = nil, target = nil) ⇒ HeaderHandler

Returns a new instance of HeaderHandler.



24
25
26
27
28
29
30
31
32
# File 'lib/virtuozzo/soap.rb', line 24

def initialize(session = nil, target = nil)
  super(XSD::QName.new(NAMESPACE, 'packet_header'))
    
  @session_elem = XSD::QName.new(NAMESPACE, 'session')
  @target_elem = XSD::QName.new(NAMESPACE, 'target')
    
  @session = session.to_s
  @target = target.to_s
end

Instance Method Details

#on_simple_outboundObject



34
35
36
37
38
39
40
41
# File 'lib/virtuozzo/soap.rb', line 34

def on_simple_outbound
  hdr = {}
    
  hdr.merge!({@session_elem => @session}) unless @session.nil?
  hdr.merge!({@target_elem => @target}) unless @target.nil? || @target == 'system'

  return hdr
end