Class: LolSoap::Request
- Inherits:
-
Object
- Object
- LolSoap::Request
- Defined in:
- lib/lolsoap/request.rb
Overview
Represents a HTTP request containing a SOAP Envelope
Instance Attribute Summary collapse
-
#envelope ⇒ Object
readonly
Returns the value of attribute envelope.
Instance Method Summary collapse
- #body(&block) ⇒ Object
-
#content ⇒ Object
The content to be sent in the HTTP request.
- #header(&block) ⇒ Object
-
#headers ⇒ Object
Headers that must be set when making the request.
-
#initialize(envelope) ⇒ Request
constructor
A new instance of Request.
-
#input_type ⇒ Object
The type of the element sent in the request body.
-
#output_type ⇒ Object
The type of the element that will be received in the response body.
-
#soap_namespace ⇒ Object
Namespace used for SOAP envelope tags.
-
#url ⇒ Object
URL to be POSTed to.
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
#envelope ⇒ Object (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
11 12 13 |
# File 'lib/lolsoap/request.rb', line 11 def body(&block) envelope.body(&block) end |
#content ⇒ Object
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
16 17 18 |
# File 'lib/lolsoap/request.rb', line 16 def header(&block) envelope.header(&block) end |
#headers ⇒ Object
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_type ⇒ Object
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_type ⇒ Object
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_namespace ⇒ Object
Namespace used for SOAP envelope tags
21 22 23 |
# File 'lib/lolsoap/request.rb', line 21 def soap_namespace envelope.soap_namespace end |
#url ⇒ Object
URL to be POSTed to
26 27 28 |
# File 'lib/lolsoap/request.rb', line 26 def url envelope.endpoint end |