Class: LolSoap::Envelope

Inherits:
Object
  • Object
show all
Defined in:
lib/lolsoap/envelope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wsdl, operation, doc = Nokogiri::XML::Document.new) ⇒ Envelope

Returns a new instance of Envelope.



14
15
16
17
18
19
20
# File 'lib/lolsoap/envelope.rb', line 14

def initialize(wsdl, operation, doc = Nokogiri::XML::Document.new)
  @wsdl      = wsdl
  @operation = operation
  @doc       = doc

  initialize_doc
end

Instance Attribute Details

#docObject (readonly)

Returns the value of attribute doc.



6
7
8
# File 'lib/lolsoap/envelope.rb', line 6

def doc
  @doc
end

#operationObject (readonly)

Returns the value of attribute operation.



6
7
8
# File 'lib/lolsoap/envelope.rb', line 6

def operation
  @operation
end

#wsdlObject (readonly)

Returns the value of attribute wsdl.



6
7
8
# File 'lib/lolsoap/envelope.rb', line 6

def wsdl
  @wsdl
end

Instance Method Details

#actionObject



45
46
47
# File 'lib/lolsoap/envelope.rb', line 45

def action
  operation.action
end

#body(klass = Builder) {|builder| ... } ⇒ Object

Build the body of the envelope

Examples:

env.body do |b|
  b.some 'data'
end

Yields:

  • (builder)


28
29
30
31
32
# File 'lib/lolsoap/envelope.rb', line 28

def body(klass = Builder)
  builder = klass.new(input, operation.input)
  yield builder if block_given?
  builder
end

#endpointObject



41
42
43
# File 'lib/lolsoap/envelope.rb', line 41

def endpoint
  wsdl.endpoint
end

#header(klass = Builder) {|builder| ... } ⇒ Object

Build the header of the envelope

Yields:

  • (builder)


35
36
37
38
39
# File 'lib/lolsoap/envelope.rb', line 35

def header(klass = Builder)
  builder = klass.new(@header)
  yield builder if block_given?
  builder
end

#input_typeObject



49
50
51
# File 'lib/lolsoap/envelope.rb', line 49

def input_type
  operation.input
end

#output_typeObject



53
54
55
# File 'lib/lolsoap/envelope.rb', line 53

def output_type
  operation.output
end

#soap_namespaceObject



65
66
67
# File 'lib/lolsoap/envelope.rb', line 65

def soap_namespace
  SOAP_NAMESPACE
end

#soap_prefixObject



61
62
63
# File 'lib/lolsoap/envelope.rb', line 61

def soap_prefix
  SOAP_PREFIX
end

#to_xmlObject



57
58
59
# File 'lib/lolsoap/envelope.rb', line 57

def to_xml
  doc.to_xml
end