Class: LabManagerHeader

Inherits:
SOAP::Header::Handler
  • Object
show all
Defined in:
lib/lab_manager.rb

Overview

<soap:Header>

  <AuthenticationHeader xmlns="http://vmware.com/labmanager">
    <username>string</username>
    <password>string</password>
    <organizationname>string</organizationname>
    <workspacename>string</workspacename>
  </AuthenticationHeader>
</soap:Header>

Instance Method Summary collapse

Constructor Details

#initialize(organization, workspace, username, password) ⇒ LabManagerHeader

Returns a new instance of LabManagerHeader.



304
305
306
307
308
309
310
# File 'lib/lab_manager.rb', line 304

def initialize(organization, workspace, username, password)
  super(XSD::QName.new("http://vmware.com/labmanager", ""))
  @organization = organization
  @workspace = workspace
  @username = username
  @password = password
end

Instance Method Details

#on_outboundObject



312
313
314
315
316
317
318
319
320
321
322
# File 'lib/lab_manager.rb', line 312

def on_outbound
  authentication = SOAP::SOAPElement.new('AuthenticationHeader')
  authentication.extraattr['xmlns'] = 'http://vmware.com/labmanager'
  
  authentication.add(SOAP::SOAPElement.new('username', @username))
  authentication.add(SOAP::SOAPElement.new('password', @password))
  authentication.add(SOAP::SOAPElement.new('organizationname', @organization))
  authentication.add(SOAP::SOAPElement.new('workspacename', @workspace)) if @workspace
  
  SOAP::SOAPHeaderItem.new(authentication, true)
end