Class: PSRP::WSMV::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wsmv/commands/base.rb

Instance Method Summary collapse

Instance Method Details

#buildObject

Builds the WSMV message XML payload



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/wsmv/commands/base.rb', line 81

def build
  builder = Builder::XmlMarkup.new
  builder.instruct!(:xml, encoding: 'UTF-8')
  builder.tag! :env, :Envelope, namespaces do |env|
    env.tag!(:env, :Header) do |env_header|
      create_header(env_header)
    end
    env.tag!(:env, :Body) do |env_body|
      create_body(env_body)
    end
  end
end

#namespacesObject



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/wsmv/commands/base.rb', line 94

def namespaces
  @namespaces ||= {
    'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
    'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
    'xmlns:env' => 'http://www.w3.org/2003/05/soap-envelope',
    "xmlns:#{NS_ADDRESSING}" => 'http://schemas.xmlsoap.org/ws/2004/08/addressing',
    "xmlns:#{NS_CIMBINDING}" => 'http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd',
    "xmlns:#{NS_ENUM}" => 'http://schemas.xmlsoap.org/ws/2004/09/enumeration',
    "xmlns:#{NS_TRANSFER}" => 'http://schemas.xmlsoap.org/ws/2004/09/transfer',
    "xmlns:#{NS_WSMAN_DMTF}" => 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd',
    "xmlns:#{NS_WSMAN_MSFT}" => 'http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd',
    "xmlns:#{NS_WIN_SHELL}" => 'http://schemas.microsoft.com/wbem/wsman/1/windows/shell',
    "xmlns:#{NS_WSMAN_CONF}" => 'http://schemas.microsoft.com/wbem/wsman/1/config'
  }
end