Class: LolSoap::Request

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

Overview

Represents a HTTP request containing a SOAP Envelope

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(envelope) ⇒ Request

Returns a new instance of Request.



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

def initialize(envelope)
  @envelope = envelope
end

Instance Attribute Details

#envelopeObject (readonly)

Returns the value of attribute envelope.



4
5
6
# File 'lib/lolsoap/request.rb', line 4

def envelope
  @envelope
end

Instance Method Details

#body(&block) ⇒ Object

See Also:



11
12
13
# File 'lib/lolsoap/request.rb', line 11

def body(&block)
  envelope.body(&block)
end

#contentObject

The content to be sent in the HTTP request



50
51
52
# File 'lib/lolsoap/request.rb', line 50

def content
  @content ||= envelope.to_xml
end

#header(&block) ⇒ Object

See Also:



16
17
18
# File 'lib/lolsoap/request.rb', line 16

def header(&block)
  envelope.header(&block)
end

#headersObject

Headers that must be set when making the request



41
42
43
44
45
46
47
# File 'lib/lolsoap/request.rb', line 41

def headers
  {
    'Content-Type'   => 'application/soap+xml;charset=UTF-8',
    'Content-Length' => content.bytesize.to_s,
    'SOAPAction'     => envelope.action
  }
end

#input_typeObject

The type of the element sent in the request body



31
32
33
# File 'lib/lolsoap/request.rb', line 31

def input_type
  envelope.input_type
end

#output_typeObject

The type of the element that will be received in the response body



36
37
38
# File 'lib/lolsoap/request.rb', line 36

def output_type
  envelope.output_type
end

#soap_namespaceObject

Namespace used for SOAP envelope tags



21
22
23
# File 'lib/lolsoap/request.rb', line 21

def soap_namespace
  envelope.soap_namespace
end

#urlObject

URL to be POSTed to



26
27
28
# File 'lib/lolsoap/request.rb', line 26

def url
  envelope.endpoint
end